aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/tests
diff options
context:
space:
mode:
authorPaul Ganssle <paul@ganssle.io>2019-03-16 12:57:57 -0400
committerPaul Ganssle <paul@ganssle.io>2019-03-16 12:58:29 -0400
commitb54d4c699fc4e1692dadd19bdd7cbcde1c844976 (patch)
tree591bda53f55e671f73c4a25785d1a9a666acced6 /setuptools/tests
parent318f739d14a810042e6803fa3eb4c4e140f0ef88 (diff)
downloadexternal_python_setuptools-b54d4c699fc4e1692dadd19bdd7cbcde1c844976.tar.gz
external_python_setuptools-b54d4c699fc4e1692dadd19bdd7cbcde1c844976.tar.bz2
external_python_setuptools-b54d4c699fc4e1692dadd19bdd7cbcde1c844976.zip
Extend requirement parsing tests to sdists
Diffstat (limited to 'setuptools/tests')
-rw-r--r--setuptools/tests/test_build_meta.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/setuptools/tests/test_build_meta.py b/setuptools/tests/test_build_meta.py
index a14a3c7a..0bdea2d6 100644
--- a/setuptools/tests/test_build_meta.py
+++ b/setuptools/tests/test_build_meta.py
@@ -300,7 +300,9 @@ class TestBuildMetaBackend:
(r"'foo\nbar\n'", ['foo', 'bar']),
(r"['foo\n', 'bar\n']", ['foo', 'bar']),
])
- def test_setup_requires(self, setup_literal, requirements, tmpdir_cwd):
+ @pytest.mark.parametrize('use_wheel', [True, False])
+ def test_setup_requires(self, setup_literal, requirements, use_wheel,
+ tmpdir_cwd):
files = {
'setup.py': DALS("""
@@ -323,9 +325,16 @@ class TestBuildMetaBackend:
build_backend = self.get_build_backend()
+ if use_wheel:
+ base_requirements = ['wheel']
+ get_requires = build_backend.get_requires_for_build_wheel
+ else:
+ base_requirements = []
+ get_requires = build_backend.get_requires_for_build_sdist
+
# Ensure that the build requirements are properly parsed
- expected = sorted(['wheel'] + requirements)
- actual = build_backend.get_requires_for_build_wheel()
+ expected = sorted(base_requirements + requirements)
+ actual = get_requires()
assert expected == sorted(actual)