Skip to content

Commit f67e10b

Browse files
committed
test: deduplicate pytest params for problem 1683
1 parent 7e1ff59 commit f67e10b

File tree

4 files changed

+19
-51
lines changed

4 files changed

+19
-51
lines changed

tests/test_datafusion.py

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

302302
@pytest.mark.parametrize(
303303
"input_data, expected_data",
304-
[
305-
(
306-
{"tweet_id": [1, 2], "content": ["Short", "This is a long tweet"]},
307-
{"tweet_id": [2]},
308-
),
309-
(
310-
{
311-
"tweet_id": [1, 2],
312-
"content": ["This is a long tweet", "Another long tweet"],
313-
},
314-
{"tweet_id": [1, 2]},
315-
),
316-
],
317-
ids=[
318-
"content_greater_than_15",
319-
"all_content_greater_than_15",
320-
],
304+
PARAMS_PROBLEM_1683,
321305
)
322306
def test_problem_1683(input_data, expected_data):
323307
table = pa.Table.from_pydict(input_data)

tests/test_pandas.py

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

10701070
@pytest.mark.parametrize(
10711071
"input_data, expected_data",
1072-
[
1073-
(
1074-
{"tweet_id": [1, 2], "content": ["Short", "This is a long tweet"]},
1075-
{"tweet_id": [2]},
1076-
),
1077-
(
1078-
{
1079-
"tweet_id": [1, 2],
1080-
"content": ["This is a long tweet", "Another long tweet"],
1081-
},
1082-
{"tweet_id": [1, 2]},
1083-
),
1084-
],
1085-
ids=[
1086-
"content_greater_than_15",
1087-
"all_content_greater_than_15",
1088-
],
1072+
PARAMS_PROBLEM_1683,
10891073
)
10901074
def test_problem_1683(input_data, expected_data):
10911075
table = pd.DataFrame(input_data)

tests/test_problem_params.py

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

12131213

1214+
PARAMS_PROBLEM_1683 = [
1215+
pytest.param(
1216+
{"tweet_id": [1, 2], "content": ["Short", "This is a long tweet"]},
1217+
{"tweet_id": [2]},
1218+
id="content_greater_than_15",
1219+
),
1220+
pytest.param(
1221+
{
1222+
"tweet_id": [1, 2],
1223+
"content": ["This is a long tweet", "Another long tweet"],
1224+
},
1225+
{"tweet_id": [1, 2]},
1226+
id="all_content_greater_than_15",
1227+
),
1228+
]
1229+
12141230
PARAMS_PROBLEM_1757 = [
12151231
(
12161232
{

tests/test_pyarrow.py

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

962962
@pytest.mark.parametrize(
963963
"input_data, expected_data",
964-
[
965-
(
966-
{"tweet_id": [1, 2], "content": ["Short", "This is a long tweet"]},
967-
{"tweet_id": [2]},
968-
),
969-
(
970-
{
971-
"tweet_id": [1, 2],
972-
"content": ["This is a long tweet", "Another long tweet"],
973-
},
974-
{"tweet_id": [1, 2]},
975-
),
976-
],
977-
ids=[
978-
"content_greater_than_15",
979-
"all_content_greater_than_15",
980-
],
964+
PARAMS_PROBLEM_1683,
981965
)
982966
def test_problem_1683(input_data, expected_data):
983967
table = pa.Table.from_pydict(input_data)

0 commit comments

Comments
 (0)