Skip to content

Commit

Permalink
test check_specifier
Browse files Browse the repository at this point in the history
  • Loading branch information
melissa-kun-li committed Feb 28, 2021
1 parent 85f824f commit 20ced75
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions setuptools/tests/test_dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
_get_unpatched,
check_package_data,
DistDeprecationWarning,
check_specifier,
)
from setuptools import sic
from setuptools import Distribution
Expand Down Expand Up @@ -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)

0 comments on commit 20ced75

Please sign in to comment.