Skip to content

Commit 50d9afb

Browse files
committed
test: deduplicate pytest params for problem 1517
1 parent a1c2661 commit 50d9afb

File tree

4 files changed

+84
-237
lines changed

4 files changed

+84
-237
lines changed

tests/test_datafusion.py

Lines changed: 1 addition & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -212,85 +212,7 @@ def test_problem_1484(input_data, expected_data):
212212

213213
@pytest.mark.parametrize(
214214
"input_data, expected_data",
215-
[
216-
pytest.param(
217-
{
218-
"user_id": [1, 2, 3, 4, 5, 6, 7],
219-
"name": [
220-
"Winston",
221-
"Jonathan",
222-
"Annabelle",
223-
"Sally",
224-
"Marwan",
225-
"David",
226-
"Shapiro",
227-
],
228-
"mail": [
229-
"winston@leetcode.com",
230-
"jonathanisgreat",
231-
"bella-@leetcode.com",
232-
"sally.come@leetcode.com",
233-
"quarz#2020@leetcode.com",
234-
"david69@gmail.com",
235-
".shapo@leetcode.com",
236-
],
237-
},
238-
{
239-
"user_id": [1, 3, 4],
240-
"name": [
241-
"Winston",
242-
"Annabelle",
243-
"Sally",
244-
],
245-
"mail": [
246-
"winston@leetcode.com",
247-
"bella-@leetcode.com",
248-
"sally.come@leetcode.com",
249-
],
250-
},
251-
id="happy_path",
252-
),
253-
pytest.param(
254-
{
255-
"user_id": [360, 966, 901, 162, 181, 240, 221, 388, 211, 178],
256-
"name": [
257-
"Ezra",
258-
"Daniel",
259-
"Yehudah",
260-
"Daniel",
261-
"Aharon",
262-
"Gavriel",
263-
"Levi",
264-
"Eliyahu",
265-
"Michael",
266-
"Aharon",
267-
],
268-
"mail": [
269-
"Ezra4VZabfK",
270-
"DanielEnEMjNoG6",
271-
"Yehudah*5m9@leetcode.com",
272-
"Daniel07L@leetcode.com",
273-
"AharonxuZA530S8Q",
274-
"GavrielLVC@leetcode.com",
275-
"Leviz6OzK@leetcode.com",
276-
"Eliyahu--wzsgX@leetcode.com",
277-
".Michael@leetcode.com",
278-
"AharonnDFFSqcY",
279-
],
280-
},
281-
{
282-
"user_id": [162, 240, 221, 388],
283-
"name": ["Daniel", "Gavriel", "Levi", "Eliyahu"],
284-
"mail": [
285-
"Daniel07L@leetcode.com",
286-
"GavrielLVC@leetcode.com",
287-
"Leviz6OzK@leetcode.com",
288-
"Eliyahu--wzsgX@leetcode.com",
289-
],
290-
},
291-
id="happy_path_2",
292-
),
293-
],
215+
PARAMS_PROBLEM_1517,
294216
)
295217
def test_problem_1517(input_data, expected_data):
296218
table = pa.Table.from_pydict(input_data)

tests/test_pandas.py

Lines changed: 1 addition & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -793,85 +793,7 @@ def test_problem_1484(input_data, expected_data):
793793

794794
@pytest.mark.parametrize(
795795
"input_data, expected_data",
796-
[
797-
pytest.param(
798-
{
799-
"user_id": [1, 2, 3, 4, 5, 6, 7],
800-
"name": [
801-
"Winston",
802-
"Jonathan",
803-
"Annabelle",
804-
"Sally",
805-
"Marwan",
806-
"David",
807-
"Shapiro",
808-
],
809-
"mail": [
810-
"winston@leetcode.com",
811-
"jonathanisgreat",
812-
"bella-@leetcode.com",
813-
"sally.come@leetcode.com",
814-
"quarz#2020@leetcode.com",
815-
"david69@gmail.com",
816-
".shapo@leetcode.com",
817-
],
818-
},
819-
{
820-
"user_id": [1, 3, 4],
821-
"name": [
822-
"Winston",
823-
"Annabelle",
824-
"Sally",
825-
],
826-
"mail": [
827-
"winston@leetcode.com",
828-
"bella-@leetcode.com",
829-
"sally.come@leetcode.com",
830-
],
831-
},
832-
id="happy_path",
833-
),
834-
pytest.param(
835-
{
836-
"user_id": [360, 966, 901, 162, 181, 240, 221, 388, 211, 178],
837-
"name": [
838-
"Ezra",
839-
"Daniel",
840-
"Yehudah",
841-
"Daniel",
842-
"Aharon",
843-
"Gavriel",
844-
"Levi",
845-
"Eliyahu",
846-
"Michael",
847-
"Aharon",
848-
],
849-
"mail": [
850-
"Ezra4VZabfK",
851-
"DanielEnEMjNoG6",
852-
"Yehudah*5m9@leetcode.com",
853-
"Daniel07L@leetcode.com",
854-
"AharonxuZA530S8Q",
855-
"GavrielLVC@leetcode.com",
856-
"Leviz6OzK@leetcode.com",
857-
"Eliyahu--wzsgX@leetcode.com",
858-
".Michael@leetcode.com",
859-
"AharonnDFFSqcY",
860-
],
861-
},
862-
{
863-
"user_id": [162, 240, 221, 388],
864-
"name": ["Daniel", "Gavriel", "Levi", "Eliyahu"],
865-
"mail": [
866-
"Daniel07L@leetcode.com",
867-
"GavrielLVC@leetcode.com",
868-
"Leviz6OzK@leetcode.com",
869-
"Eliyahu--wzsgX@leetcode.com",
870-
],
871-
},
872-
id="happy_path_2",
873-
),
874-
],
796+
PARAMS_PROBLEM_1517,
875797
)
876798
def test_problem_1517(input_data, expected_data):
877799
table = pd.DataFrame(input_data)

tests/test_problem_params.py

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1211,6 +1211,87 @@
12111211
]
12121212

12131213

1214+
PARAMS_PROBLEM_1517 = [
1215+
pytest.param(
1216+
{
1217+
"user_id": [1, 2, 3, 4, 5, 6, 7],
1218+
"name": [
1219+
"Winston",
1220+
"Jonathan",
1221+
"Annabelle",
1222+
"Sally",
1223+
"Marwan",
1224+
"David",
1225+
"Shapiro",
1226+
],
1227+
"mail": [
1228+
"winston@leetcode.com",
1229+
"jonathanisgreat",
1230+
"bella-@leetcode.com",
1231+
"sally.come@leetcode.com",
1232+
"quarz#2020@leetcode.com",
1233+
"david69@gmail.com",
1234+
".shapo@leetcode.com",
1235+
],
1236+
},
1237+
{
1238+
"user_id": [1, 3, 4],
1239+
"name": [
1240+
"Winston",
1241+
"Annabelle",
1242+
"Sally",
1243+
],
1244+
"mail": [
1245+
"winston@leetcode.com",
1246+
"bella-@leetcode.com",
1247+
"sally.come@leetcode.com",
1248+
],
1249+
},
1250+
id="happy_path",
1251+
),
1252+
pytest.param(
1253+
{
1254+
"user_id": [360, 966, 901, 162, 181, 240, 221, 388, 211, 178],
1255+
"name": [
1256+
"Ezra",
1257+
"Daniel",
1258+
"Yehudah",
1259+
"Daniel",
1260+
"Aharon",
1261+
"Gavriel",
1262+
"Levi",
1263+
"Eliyahu",
1264+
"Michael",
1265+
"Aharon",
1266+
],
1267+
"mail": [
1268+
"Ezra4VZabfK",
1269+
"DanielEnEMjNoG6",
1270+
"Yehudah*5m9@leetcode.com",
1271+
"Daniel07L@leetcode.com",
1272+
"AharonxuZA530S8Q",
1273+
"GavrielLVC@leetcode.com",
1274+
"Leviz6OzK@leetcode.com",
1275+
"Eliyahu--wzsgX@leetcode.com",
1276+
".Michael@leetcode.com",
1277+
"AharonnDFFSqcY",
1278+
],
1279+
},
1280+
{
1281+
"user_id": [162, 240, 221, 388],
1282+
"name": ["Daniel", "Gavriel", "Levi", "Eliyahu"],
1283+
"mail": [
1284+
"Daniel07L@leetcode.com",
1285+
"GavrielLVC@leetcode.com",
1286+
"Leviz6OzK@leetcode.com",
1287+
"Eliyahu--wzsgX@leetcode.com",
1288+
],
1289+
},
1290+
id="happy_path_2",
1291+
),
1292+
]
1293+
1294+
12141295
PARAMS_PROBLEM_1683 = [
12151296
pytest.param(
12161297
{"tweet_id": [1, 2], "content": ["Short", "This is a long tweet"]},

tests/test_pyarrow.py

Lines changed: 1 addition & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -692,85 +692,7 @@ def test_problem_1378(input_data_1, input_data_2, expected_data):
692692

693693
@pytest.mark.parametrize(
694694
"input_data, expected_data",
695-
[
696-
pytest.param(
697-
{
698-
"user_id": [1, 2, 3, 4, 5, 6, 7],
699-
"name": [
700-
"Winston",
701-
"Jonathan",
702-
"Annabelle",
703-
"Sally",
704-
"Marwan",
705-
"David",
706-
"Shapiro",
707-
],
708-
"mail": [
709-
"winston@leetcode.com",
710-
"jonathanisgreat",
711-
"bella-@leetcode.com",
712-
"sally.come@leetcode.com",
713-
"quarz#2020@leetcode.com",
714-
"david69@gmail.com",
715-
".shapo@leetcode.com",
716-
],
717-
},
718-
{
719-
"user_id": [1, 3, 4],
720-
"name": [
721-
"Winston",
722-
"Annabelle",
723-
"Sally",
724-
],
725-
"mail": [
726-
"winston@leetcode.com",
727-
"bella-@leetcode.com",
728-
"sally.come@leetcode.com",
729-
],
730-
},
731-
id="happy_path",
732-
),
733-
pytest.param(
734-
{
735-
"user_id": [360, 966, 901, 162, 181, 240, 221, 388, 211, 178],
736-
"name": [
737-
"Ezra",
738-
"Daniel",
739-
"Yehudah",
740-
"Daniel",
741-
"Aharon",
742-
"Gavriel",
743-
"Levi",
744-
"Eliyahu",
745-
"Michael",
746-
"Aharon",
747-
],
748-
"mail": [
749-
"Ezra4VZabfK",
750-
"DanielEnEMjNoG6",
751-
"Yehudah*5m9@leetcode.com",
752-
"Daniel07L@leetcode.com",
753-
"AharonxuZA530S8Q",
754-
"GavrielLVC@leetcode.com",
755-
"Leviz6OzK@leetcode.com",
756-
"Eliyahu--wzsgX@leetcode.com",
757-
".Michael@leetcode.com",
758-
"AharonnDFFSqcY",
759-
],
760-
},
761-
{
762-
"user_id": [162, 240, 221, 388],
763-
"name": ["Daniel", "Gavriel", "Levi", "Eliyahu"],
764-
"mail": [
765-
"Daniel07L@leetcode.com",
766-
"GavrielLVC@leetcode.com",
767-
"Leviz6OzK@leetcode.com",
768-
"Eliyahu--wzsgX@leetcode.com",
769-
],
770-
},
771-
id="happy_path_2",
772-
),
773-
],
695+
PARAMS_PROBLEM_1517,
774696
)
775697
def test_problem_1517(input_data, expected_data):
776698
table = pa.Table.from_pydict(input_data)

0 commit comments

Comments
 (0)