Skip to content

Commit faeca9c

Browse files
committed
test: deduplicate pytest params for problem 1661
1 parent 4cf7c5d commit faeca9c

File tree

3 files changed

+34
-64
lines changed

3 files changed

+34
-64
lines changed

tests/test_pandas.py

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -680,38 +680,7 @@ def test_problem_1633(input_data_1, input_data_2, expected_data):
680680

681681
@pytest.mark.parametrize(
682682
"input_data, expected_data",
683-
[
684-
pytest.param(
685-
{
686-
"machine_id": [0, 0, 0, 0],
687-
"process_id": [0, 0, 1, 1],
688-
"activity_type": ["start", "end", "start", "end"],
689-
"timestamp": [0.712, 1.52, 3.14, 4.12],
690-
},
691-
{"machine_id": [0], "processing_time": [0.894]},
692-
id="happy_path_single_machine",
693-
),
694-
pytest.param(
695-
{
696-
"machine_id": [0, 0, 1, 1, 2, 2],
697-
"process_id": [0, 0, 1, 1, 2, 2],
698-
"activity_type": ["start", "end", "start", "end", "start", "end"],
699-
"timestamp": [0.5, 1.5, 0.7, 1.2, 0.9, 2.0],
700-
},
701-
{"machine_id": [0, 1, 2], "processing_time": [1.0, 0.5, 1.1]},
702-
id="multiple_machines",
703-
),
704-
pytest.param(
705-
{
706-
"machine_id": [0, 0, 1],
707-
"process_id": [0, 0, 1],
708-
"activity_type": ["start", "end", "start"],
709-
"timestamp": [0.5, 1.5, 0.7],
710-
},
711-
{"machine_id": [0, 1], "processing_time": [1.0, None]},
712-
id="incomplete_process",
713-
),
714-
],
683+
PARAMS_PROBLEM_1661,
715684
)
716685
def test_problem_1661(input_data, expected_data):
717686
table = pd.DataFrame(input_data)

tests/test_problem_params.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1534,6 +1534,38 @@
15341534
),
15351535
]
15361536

1537+
PARAMS_PROBLEM_1661 = [
1538+
pytest.param(
1539+
{
1540+
"machine_id": [0, 0, 0, 0],
1541+
"process_id": [0, 0, 1, 1],
1542+
"activity_type": ["start", "end", "start", "end"],
1543+
"timestamp": [0.712, 1.52, 3.14, 4.12],
1544+
},
1545+
{"machine_id": [0], "processing_time": [0.894]},
1546+
id="happy_path_single_machine",
1547+
),
1548+
pytest.param(
1549+
{
1550+
"machine_id": [0, 0, 1, 1, 2, 2],
1551+
"process_id": [0, 0, 1, 1, 2, 2],
1552+
"activity_type": ["start", "end", "start", "end", "start", "end"],
1553+
"timestamp": [0.5, 1.5, 0.7, 1.2, 0.9, 2.0],
1554+
},
1555+
{"machine_id": [0, 1, 2], "processing_time": [1.0, 0.5, 1.1]},
1556+
id="multiple_machines",
1557+
),
1558+
pytest.param(
1559+
{
1560+
"machine_id": [0, 0, 1],
1561+
"process_id": [0, 0, 1],
1562+
"activity_type": ["start", "end", "start"],
1563+
"timestamp": [0.5, 1.5, 0.7],
1564+
},
1565+
{"machine_id": [0, 1], "processing_time": [1.0, None]},
1566+
id="incomplete_process",
1567+
),
1568+
]
15371569

15381570
PARAMS_PROBLEM_1683 = [
15391571
pytest.param(

tests/test_pyarrow.py

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -610,38 +610,7 @@ def test_problem_1633(input_data_1, input_data_2, expected_data):
610610

611611
@pytest.mark.parametrize(
612612
"input_data, expected_data",
613-
[
614-
pytest.param(
615-
{
616-
"machine_id": [0, 0, 0, 0],
617-
"process_id": [0, 0, 1, 1],
618-
"activity_type": ["start", "end", "start", "end"],
619-
"timestamp": [0.712, 1.52, 3.14, 4.12],
620-
},
621-
{"machine_id": [0], "processing_time": [0.894]},
622-
id="happy_path_single_machine",
623-
),
624-
pytest.param(
625-
{
626-
"machine_id": [0, 0, 1, 1, 2, 2],
627-
"process_id": [0, 0, 1, 1, 2, 2],
628-
"activity_type": ["start", "end", "start", "end", "start", "end"],
629-
"timestamp": [0.5, 1.5, 0.7, 1.2, 0.9, 2.0],
630-
},
631-
{"machine_id": [0, 1, 2], "processing_time": [1.0, 0.5, 1.1]},
632-
id="multiple_machines",
633-
),
634-
pytest.param(
635-
{
636-
"machine_id": [0, 0, 1],
637-
"process_id": [0, 0, 1],
638-
"activity_type": ["start", "end", "start"],
639-
"timestamp": [0.5, 1.5, 0.7],
640-
},
641-
{"machine_id": [0, 1], "processing_time": [1.0, None]},
642-
id="incomplete_process",
643-
),
644-
],
613+
PARAMS_PROBLEM_1661,
645614
)
646615
def test_problem_1661(input_data, expected_data):
647616
input_table = pa.Table.from_pydict(input_data)

0 commit comments

Comments
 (0)