diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2019-10-06 21:29:51 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-06 21:29:51 -0400 |
commit | 01bf4fb2b13c3f7f6d9e8d253d2923b5ea09caa2 (patch) | |
tree | a3eea31cca692d8dd2704b475dbd8ebf473a0e56 /setuptools/tests | |
parent | da3ccf5f648a5836ce5e9b0747a263860ae1dfaa (diff) | |
parent | 2e3c34f669c5272d036ef7edc58871c96663d587 (diff) | |
download | external_python_setuptools-01bf4fb2b13c3f7f6d9e8d253d2923b5ea09caa2.tar.gz external_python_setuptools-01bf4fb2b13c3f7f6d9e8d253d2923b5ea09caa2.tar.bz2 external_python_setuptools-01bf4fb2b13c3f7f6d9e8d253d2923b5ea09caa2.zip |
Merge pull request #1847 from pypa/bugfix/1787-python-requires-invalid
Crash when invalid python_requires indicated in setup.cfg
Diffstat (limited to 'setuptools/tests')
-rw-r--r-- | setuptools/tests/test_config.py | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/setuptools/tests/test_config.py b/setuptools/tests/test_config.py index bc97664d..1b94a586 100644 --- a/setuptools/tests/test_config.py +++ b/setuptools/tests/test_config.py @@ -819,6 +819,40 @@ class TestOptions: ] assert sorted(dist.data_files) == sorted(expected) + def test_python_requires_simple(self, tmpdir): + fake_env( + tmpdir, + DALS(""" + [options] + python_requires=>=2.7 + """), + ) + with get_dist(tmpdir) as dist: + dist.parse_config_files() + + def test_python_requires_compound(self, tmpdir): + fake_env( + tmpdir, + DALS(""" + [options] + python_requires=>=2.7,!=3.0.* + """), + ) + with get_dist(tmpdir) as dist: + dist.parse_config_files() + + def test_python_requires_invalid(self, tmpdir): + fake_env( + tmpdir, + DALS(""" + [options] + python_requires=invalid + """), + ) + with pytest.raises(Exception): + with get_dist(tmpdir) as dist: + dist.parse_config_files() + saved_dist_init = _Distribution.__init__ |