Skip to content

Commit

Permalink
Test for uppercase metadata warning
Browse files Browse the repository at this point in the history
  • Loading branch information
melissa-kun-li committed Mar 6, 2021
1 parent 132a6cd commit fa48ac3
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions setuptools/tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,24 @@ def test_dash_to_underscore_warning(self, tmpdir):
assert metadata.author_email == 'test@test.com'
assert metadata.maintainer_email == 'foo@foo.com'

def test_uppercase_warning(self, tmpdir):
# remove this test and the method uppercase_warning() in setuptools.dist
# when no longer needed
fake_env(
tmpdir,
'[metadata]\n'
'Name = foo\n'
'description = Some description\n'
)
msg = ("Usage of uppercase key 'Name' in 'metadata' will be deprecated in "
"future versions. "
"Please use lowercase 'name' instead")
with pytest.warns(UserWarning, match=msg):
with get_dist(tmpdir) as dist:
metadata = dist.metadata
assert metadata.name == 'foo'
assert metadata.description == 'Some description'


class TestOptions:

Expand Down

0 comments on commit fa48ac3

Please sign in to comment.