Skip to content

Commit a1c2661

Browse files
committed
test: deduplicate pytest params for problem 1729
1 parent f67e10b commit a1c2661

File tree

3 files changed

+20
-34
lines changed

3 files changed

+20
-34
lines changed

tests/test_pandas.py

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,23 +1082,7 @@ def test_problem_1683(input_data, expected_data):
10821082

10831083
@pytest.mark.parametrize(
10841084
"input_data, expected_data",
1085-
[
1086-
pytest.param(
1087-
{"user_id": [1, 1, 2, 2, 3], "follower_id": [10, 11, 12, 13, 14]},
1088-
{"user_id": [1, 2, 3], "followers_count": [2, 2, 1]},
1089-
id="multiple_users",
1090-
),
1091-
pytest.param(
1092-
{"user_id": [1], "follower_id": [10]},
1093-
{"user_id": [1], "followers_count": [1]},
1094-
id="single_user",
1095-
),
1096-
pytest.param(
1097-
{"user_id": [1, 1, 1], "follower_id": [10, 11, 12]},
1098-
{"user_id": [1], "followers_count": [3]},
1099-
id="single_user_multiple_followers",
1100-
),
1101-
],
1085+
PARAMS_PROBLEM_1729,
11021086
)
11031087
def test_problem_1729(input_data, expected_data):
11041088
table = pd.DataFrame(input_data)

tests/test_problem_params.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1227,6 +1227,24 @@
12271227
),
12281228
]
12291229

1230+
PARAMS_PROBLEM_1729 = [
1231+
pytest.param(
1232+
{"user_id": [1, 1, 2, 2, 3], "follower_id": [10, 11, 12, 13, 14]},
1233+
{"user_id": [1, 2, 3], "followers_count": [2, 2, 1]},
1234+
id="multiple_users",
1235+
),
1236+
pytest.param(
1237+
{"user_id": [1], "follower_id": [10]},
1238+
{"user_id": [1], "followers_count": [1]},
1239+
id="single_user",
1240+
),
1241+
pytest.param(
1242+
{"user_id": [1, 1, 1], "follower_id": [10, 11, 12]},
1243+
{"user_id": [1], "followers_count": [3]},
1244+
id="single_user_multiple_followers",
1245+
),
1246+
]
1247+
12301248
PARAMS_PROBLEM_1757 = [
12311249
(
12321250
{

tests/test_pyarrow.py

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -972,23 +972,7 @@ def test_problem_1683(input_data, expected_data):
972972

973973
@pytest.mark.parametrize(
974974
"input_data, expected_data",
975-
[
976-
pytest.param(
977-
{"user_id": [1, 1, 2, 2, 3], "follower_id": [10, 11, 12, 13, 14]},
978-
{"user_id": [1, 2, 3], "followers_count": [2, 2, 1]},
979-
id="multiple_users",
980-
),
981-
pytest.param(
982-
{"user_id": [1], "follower_id": [10]},
983-
{"user_id": [1], "followers_count": [1]},
984-
id="single_user",
985-
),
986-
pytest.param(
987-
{"user_id": [1, 1, 1], "follower_id": [10, 11, 12]},
988-
{"user_id": [1], "followers_count": [3]},
989-
id="single_user_multiple_followers",
990-
),
991-
],
975+
PARAMS_PROBLEM_1729,
992976
)
993977
def test_problem_1729(input_data, expected_data):
994978
table = pa.Table.from_pydict(input_data)

0 commit comments

Comments
 (0)