diff options
| author | Melissa Li <li.melissa.kun@gmail.com> | 2021-03-05 23:20:59 -0500 |
|---|---|---|
| committer | Melissa Li <li.melissa.kun@gmail.com> | 2021-03-05 23:21:58 -0500 |
| commit | fa48ac3626c21efc5261b4f112270ca40d2e004d (patch) | |
| tree | 497eeca10f85ad5c906e41d086f4c2b892193168 | |
| parent | 132a6cde2a47f34680527258a3753a692e23b266 (diff) | |
| download | python-setuptools-git-fa48ac3626c21efc5261b4f112270ca40d2e004d.tar.gz | |
Test for uppercase metadata warning
| -rw-r--r-- | setuptools/tests/test_config.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/setuptools/tests/test_config.py b/setuptools/tests/test_config.py index eac26749..454ffb24 100644 --- a/setuptools/tests/test_config.py +++ b/setuptools/tests/test_config.py @@ -526,6 +526,24 @@ class TestMetadata: 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: |
