Skip to content

Commit 656924e

Browse files
committed
test: deduplicate pytest params for problem 1075
1 parent e4c8c5a commit 656924e

File tree

3 files changed

+25
-44
lines changed

3 files changed

+25
-44
lines changed

tests/test_pandas.py

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -275,28 +275,7 @@ def test_problem_1070(input_data, expected_data):
275275

276276
@pytest.mark.parametrize(
277277
"input_data_1, input_data_2, expected_data",
278-
[
279-
pytest.param(
280-
{
281-
"employee_id": [1, 2, 3],
282-
"project_id": [101, 102, 103],
283-
"experience_years": [5, 10, 15],
284-
},
285-
{"employee_id": [1, 2, 3], "department": ["HR", "IT", "Finance"]},
286-
{"project_id": [101, 102, 103], "average_years": [5.0, 10.0, 15.0]},
287-
id="happy_path",
288-
),
289-
pytest.param(
290-
{
291-
"employee_id": [1, 2, 3],
292-
"project_id": [101, 101, 101],
293-
"experience_years": [33, 34, 34],
294-
},
295-
{"employee_id": [1, 2, 3], "department": ["HR", "IT", "IT"]},
296-
{"project_id": [101], "average_years": [33.67]},
297-
id="happy_path_rounding_2",
298-
),
299-
],
278+
PARAMS_PROBLEM_1075,
300279
)
301280
def test_problem_1075(input_data_1, input_data_2, expected_data):
302281
table_1 = pd.DataFrame(input_data_1)

tests/test_problem_params.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -839,6 +839,29 @@
839839
]
840840

841841

842+
PARAMS_PROBLEM_1075 = [
843+
pytest.param(
844+
{
845+
"employee_id": [1, 2, 3],
846+
"project_id": [101, 102, 103],
847+
"experience_years": [5, 10, 15],
848+
},
849+
{"employee_id": [1, 2, 3], "department": ["HR", "IT", "Finance"]},
850+
{"project_id": [101, 102, 103], "average_years": [5.0, 10.0, 15.0]},
851+
id="happy_path",
852+
),
853+
pytest.param(
854+
{
855+
"employee_id": [1, 2, 3],
856+
"project_id": [101, 101, 101],
857+
"experience_years": [33, 34, 34],
858+
},
859+
{"employee_id": [1, 2, 3], "department": ["HR", "IT", "IT"]},
860+
{"project_id": [101], "average_years": [33.67]},
861+
id="happy_path_rounding_2",
862+
),
863+
]
864+
842865
PARAMS_PROBLEMS_1141 = [
843866
pytest.param(
844867
{

tests/test_pyarrow.py

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -263,28 +263,7 @@ def test_problem_1070(input_data, expected_data):
263263

264264
@pytest.mark.parametrize(
265265
"input_data_1, input_data_2, expected_data",
266-
[
267-
pytest.param(
268-
{
269-
"employee_id": [1, 2, 3],
270-
"project_id": [101, 102, 103],
271-
"experience_years": [5, 10, 15],
272-
},
273-
{"employee_id": [1, 2, 3], "department": ["HR", "IT", "Finance"]},
274-
{"project_id": [101, 102, 103], "average_years": [5.0, 10.0, 15.0]},
275-
id="happy_path",
276-
),
277-
pytest.param(
278-
{
279-
"employee_id": [1, 2, 3],
280-
"project_id": [101, 101, 101],
281-
"experience_years": [33, 34, 34],
282-
},
283-
{"employee_id": [1, 2, 3], "department": ["HR", "IT", "IT"]},
284-
{"project_id": [101], "average_years": [33.67]},
285-
id="happy_path_rounding_2",
286-
),
287-
],
266+
PARAMS_PROBLEM_1075,
288267
)
289268
def test_problem_1075(input_data_1, input_data_2, expected_data):
290269
table_1 = pa.Table.from_pydict(input_data_1)

0 commit comments

Comments
 (0)