diff options
author | Anderson Bravalheri <andersonbravalheri@gmail.com> | 2023-03-08 20:22:59 +0000 |
---|---|---|
committer | Anderson Bravalheri <andersonbravalheri@gmail.com> | 2023-05-03 14:09:17 +0100 |
commit | bc4b0568ccb5bda56c45adb0575afbbb4939d66a (patch) | |
tree | 1372c52ceed8f792c8b1e25a32b455665f58c8ee | |
parent | 64703c0be5909afa2eeb51b926ad995a0a1e2b1f (diff) | |
download | python-setuptools-git-bc4b0568ccb5bda56c45adb0575afbbb4939d66a.tar.gz |
Adjust apply_pyproject tests
-rw-r--r-- | setuptools/tests/config/test_apply_pyprojecttoml.py | 13 |
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() |