Skip to content

Commit ac849fa

Browse files
committed
De-duplicate code in test_import_tools.py
1 parent be27d9b commit ac849fa

File tree

1 file changed

+5
-50
lines changed

1 file changed

+5
-50
lines changed

tests/test_import_tools.py

Lines changed: 5 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def test_discover_entry_points_by_name_name_match_func(advanced_data_regression:
126126
advanced_data_regression.check({k: v.__name__ for k, v in entry_points.items()})
127127

128128

129-
@pytest.mark.parametrize(
129+
iter_submodules_versions = pytest.mark.parametrize(
130130
"version",
131131
[
132132
pytest.param(3.6, marks=only_version(3.6, reason="Output differs on Python 3.6")),
@@ -175,6 +175,9 @@ def test_discover_entry_points_by_name_name_match_func(advanced_data_regression:
175175
pytest.param("3.10", marks=only_version("3.10", reason="Output differs on Python 3.10")),
176176
]
177177
)
178+
179+
180+
@iter_submodules_versions
178181
@pytest.mark.parametrize(
179182
"module",
180183
["collections", "importlib", "domdf_python_tools", "consolekit", "json", "cRQefleMvm", "reprlib"],
@@ -233,55 +236,7 @@ def freedesktop_os_release():
233236
pass
234237

235238

236-
@pytest.mark.parametrize(
237-
"version",
238-
[
239-
pytest.param(3.6, marks=only_version(3.6, reason="Output differs on Python 3.6")),
240-
pytest.param(
241-
3.7,
242-
marks=[
243-
only_version(3.7, reason="Output differs on Python 3.7"),
244-
not_pypy("Output differs on PyPy")
245-
]
246-
),
247-
pytest.param(
248-
"3.7-pypy",
249-
marks=[
250-
only_version(3.7, reason="Output differs on Python 3.7"),
251-
only_pypy("Output differs on PyPy")
252-
]
253-
),
254-
pytest.param(
255-
3.8,
256-
marks=[
257-
only_version(3.8, reason="Output differs on Python 3.8"),
258-
not_pypy("Output differs on PyPy 3.8")
259-
]
260-
),
261-
pytest.param(
262-
"3.8_pypy",
263-
marks=[
264-
only_version(3.8, reason="Output differs on Python 3.8"),
265-
only_pypy("Output differs on PyPy 3.8")
266-
]
267-
),
268-
pytest.param(
269-
3.9,
270-
marks=[
271-
only_version(3.9, reason="Output differs on Python 3.9"),
272-
not_pypy("Output differs on PyPy 3.9")
273-
]
274-
),
275-
pytest.param(
276-
"3.9_pypy",
277-
marks=[
278-
only_version(3.9, reason="Output differs on Python 3.9"),
279-
only_pypy("Output differs on PyPy 3.9")
280-
]
281-
),
282-
pytest.param("3.10", marks=only_version("3.10", reason="Output differs on Python 3.10")),
283-
]
284-
)
239+
@iter_submodules_versions
285240
@pytest.mark.parametrize(
286241
"platform",
287242
[

0 commit comments

Comments
 (0)