Skip to content

Commit ca23288

Browse files
committed
test: deduplicate pytest params for problem 1527
1 parent 10d52a4 commit ca23288

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
@@ -541,23 +541,7 @@ def test_problem_1517(input_data, expected_data):
541541

542542
@pytest.mark.parametrize(
543543
"input_data, expected_data",
544-
[
545-
pytest.param(
546-
{"conditions": ["DIAB1", "DIAB2", "DIAB3"]},
547-
{"conditions": ["DIAB1"]},
548-
id="starts_with_DIAB1",
549-
),
550-
pytest.param(
551-
{"conditions": ["X DIAB1", "Y DIAB2", "Z DIAB1X"]},
552-
{"conditions": ["X DIAB1", "Z DIAB1X"]},
553-
id="contains_DIAB1",
554-
),
555-
pytest.param(
556-
{"conditions": ["X DIAB1", "Y +DIAB1", "Z DIAB1X"]},
557-
{"conditions": ["X DIAB1", "Z DIAB1X"]},
558-
id="contains_DIAB1_and_not_prefixed_strangely",
559-
),
560-
],
544+
PARAMS_PROBLEM_1527,
561545
)
562546
def test_problem_1527(input_data, expected_data):
563547
table = pd.DataFrame(input_data)

tests/test_problem_params.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1572,6 +1572,24 @@
15721572
),
15731573
]
15741574

1575+
PARAMS_PROBLEM_1527 = [
1576+
pytest.param(
1577+
{"conditions": ["DIAB1", "DIAB2", "DIAB3"]},
1578+
{"conditions": ["DIAB1"]},
1579+
id="starts_with_DIAB1",
1580+
),
1581+
pytest.param(
1582+
{"conditions": ["X DIAB1", "Y DIAB2", "Z DIAB1X"]},
1583+
{"conditions": ["X DIAB1", "Z DIAB1X"]},
1584+
id="contains_DIAB1",
1585+
),
1586+
pytest.param(
1587+
{"conditions": ["X DIAB1", "Y +DIAB1", "Z DIAB1X"]},
1588+
{"conditions": ["X DIAB1", "Z DIAB1X"]},
1589+
id="contains_DIAB1_and_not_prefixed_strangely",
1590+
),
1591+
]
1592+
15751593

15761594
PARAMS_PROBLEM_1581 = [
15771595
pytest.param(

tests/test_pyarrow.py

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

476476
@pytest.mark.parametrize(
477477
"input_data, expected_data",
478-
[
479-
pytest.param(
480-
{"conditions": ["DIAB1", "DIAB2", "DIAB3"]},
481-
{"conditions": ["DIAB1"]},
482-
id="starts_with_DIAB1",
483-
),
484-
pytest.param(
485-
{"conditions": ["X DIAB1", "Y DIAB2", "Z DIAB1X"]},
486-
{"conditions": ["X DIAB1", "Z DIAB1X"]},
487-
id="contains_DIAB1",
488-
),
489-
pytest.param(
490-
{"conditions": ["X DIAB1", "Y +DIAB1", "Z DIAB1X"]},
491-
{"conditions": ["X DIAB1", "Z DIAB1X"]},
492-
id="contains_DIAB1_and_not_prefixed_strangely",
493-
),
494-
],
478+
PARAMS_PROBLEM_1527,
495479
)
496480
def test_problem_1527(input_data, expected_data):
497481
table = pa.Table.from_pydict(input_data)

0 commit comments

Comments
 (0)