summaryrefslogtreecommitdiff
path: root/setuptools/tests
diff options
context:
space:
mode:
Diffstat (limited to 'setuptools/tests')
-rw-r--r--setuptools/tests/config/test_apply_pyprojecttoml.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/setuptools/tests/config/test_apply_pyprojecttoml.py b/setuptools/tests/config/test_apply_pyprojecttoml.py
index b08f4164..fa2016f0 100644
--- a/setuptools/tests/config/test_apply_pyprojecttoml.py
+++ b/setuptools/tests/config/test_apply_pyprojecttoml.py
@@ -45,6 +45,7 @@ def test_apply_pyproject_equivalent_to_setupcfg(url, monkeypatch, tmp_path):
dist_toml = pyprojecttoml.apply_configuration(makedist(tmp_path), pyproject_example)
dist_cfg = setupcfg.apply_configuration(makedist(tmp_path), setupcfg_example)
+ _port_tests_require(dist_cfg)
pkg_info_toml = core_metadata(dist_toml)
pkg_info_cfg = core_metadata(dist_cfg)
@@ -440,3 +441,15 @@ def core_metadata(dist) -> str:
result.append(line + "\n")
return "".join(result)
+
+
+def _port_tests_require(dist):
+ """
+ ``ini2toml`` "forward fix" deprecated tests_require definitions by moving
+ them into an extra called ``testing``.
+ """
+ tests_require = getattr(dist, "tests_require", None) or []
+ if tests_require:
+ dist.tests_require = []
+ dist.extras_require.setdefault("testing", []).extend(tests_require)
+ dist._finalize_requires()