diff options
| author | Melissa Li <li.melissa.kun@gmail.com> | 2021-02-28 00:59:58 -0500 |
|---|---|---|
| committer | Melissa Li <li.melissa.kun@gmail.com> | 2021-02-28 01:49:54 -0500 |
| commit | 20ced7533c2b737e9d99deacd97633f84b26567d (patch) | |
| tree | 0d4f620069fd9776f861a28dfd1e54bfa0383857 | |
| parent | 85f824f49d69177f68245b9788acaf5ace97afb7 (diff) | |
| download | python-setuptools-git-20ced7533c2b737e9d99deacd97633f84b26567d.tar.gz | |
test check_specifier
| -rw-r--r-- | setuptools/tests/test_dist.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/setuptools/tests/test_dist.py b/setuptools/tests/test_dist.py index cb47fb58..e4bba47b 100644 --- a/setuptools/tests/test_dist.py +++ b/setuptools/tests/test_dist.py @@ -9,6 +9,7 @@ from setuptools.dist import ( _get_unpatched, check_package_data, DistDeprecationWarning, + check_specifier, ) from setuptools import sic from setuptools import Distribution @@ -323,3 +324,15 @@ def test_check_package_data(package_data, expected_message): with pytest.raises( DistutilsSetupError, match=re.escape(expected_message)): check_package_data(None, str('package_data'), package_data) + + +def test_check_specifier(): + # valid specifier value + attrs = {'name': 'foo', 'python_requires': '>=3.0, !=3.1'} + dist = Distribution(attrs) + check_specifier(dist, attrs, attrs['python_requires']) + + # invalid specifier value + attrs = {'name': 'foo', 'python_requires': ['>=3.0', '!=3.1']} + with pytest.raises(DistutilsSetupError): + dist = Distribution(attrs) |
