Skip to content

Commit

Permalink
test: deduplicate pytest params for problem 1729
Browse files Browse the repository at this point in the history
  • Loading branch information
IndexSeek committed Jan 21, 2025
1 parent f67e10b commit a1c2661
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 34 deletions.
18 changes: 1 addition & 17 deletions tests/test_pandas.py
Original file line number Diff line number Diff line change
Expand Up @@ -1082,23 +1082,7 @@ def test_problem_1683(input_data, expected_data):

@pytest.mark.parametrize(
"input_data, expected_data",
[
pytest.param(
{"user_id": [1, 1, 2, 2, 3], "follower_id": [10, 11, 12, 13, 14]},
{"user_id": [1, 2, 3], "followers_count": [2, 2, 1]},
id="multiple_users",
),
pytest.param(
{"user_id": [1], "follower_id": [10]},
{"user_id": [1], "followers_count": [1]},
id="single_user",
),
pytest.param(
{"user_id": [1, 1, 1], "follower_id": [10, 11, 12]},
{"user_id": [1], "followers_count": [3]},
id="single_user_multiple_followers",
),
],
PARAMS_PROBLEM_1729,
)
def test_problem_1729(input_data, expected_data):
table = pd.DataFrame(input_data)
Expand Down
18 changes: 18 additions & 0 deletions tests/test_problem_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -1227,6 +1227,24 @@
),
]

PARAMS_PROBLEM_1729 = [
pytest.param(
{"user_id": [1, 1, 2, 2, 3], "follower_id": [10, 11, 12, 13, 14]},
{"user_id": [1, 2, 3], "followers_count": [2, 2, 1]},
id="multiple_users",
),
pytest.param(
{"user_id": [1], "follower_id": [10]},
{"user_id": [1], "followers_count": [1]},
id="single_user",
),
pytest.param(
{"user_id": [1, 1, 1], "follower_id": [10, 11, 12]},
{"user_id": [1], "followers_count": [3]},
id="single_user_multiple_followers",
),
]

PARAMS_PROBLEM_1757 = [
(
{
Expand Down
18 changes: 1 addition & 17 deletions tests/test_pyarrow.py
Original file line number Diff line number Diff line change
Expand Up @@ -972,23 +972,7 @@ def test_problem_1683(input_data, expected_data):

@pytest.mark.parametrize(
"input_data, expected_data",
[
pytest.param(
{"user_id": [1, 1, 2, 2, 3], "follower_id": [10, 11, 12, 13, 14]},
{"user_id": [1, 2, 3], "followers_count": [2, 2, 1]},
id="multiple_users",
),
pytest.param(
{"user_id": [1], "follower_id": [10]},
{"user_id": [1], "followers_count": [1]},
id="single_user",
),
pytest.param(
{"user_id": [1, 1, 1], "follower_id": [10, 11, 12]},
{"user_id": [1], "followers_count": [3]},
id="single_user_multiple_followers",
),
],
PARAMS_PROBLEM_1729,
)
def test_problem_1729(input_data, expected_data):
table = pa.Table.from_pydict(input_data)
Expand Down

0 comments on commit a1c2661

Please sign in to comment.