diff options
| author | Melissa Li <li.melissa.kun@gmail.com> | 2021-03-02 22:54:53 -0500 |
|---|---|---|
| committer | Melissa Li <li.melissa.kun@gmail.com> | 2021-03-02 22:54:53 -0500 |
| commit | 08d6a2f2b0fb4b57f749d0adaaca3efc158419cd (patch) | |
| tree | 5a67a63d82f08fd65bcbeb0f9e49ab556d9734b8 /setuptools/tests | |
| parent | d027d6d2140daf87079dd3bd186585a5b063269e (diff) | |
| download | python-setuptools-git-08d6a2f2b0fb4b57f749d0adaaca3efc158419cd.tar.gz | |
Add test for conversion warning
Diffstat (limited to 'setuptools/tests')
| -rw-r--r-- | setuptools/tests/test_config.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/setuptools/tests/test_config.py b/setuptools/tests/test_config.py index 0983f836..4a399179 100644 --- a/setuptools/tests/test_config.py +++ b/setuptools/tests/test_config.py @@ -507,6 +507,25 @@ class TestMetadata: with get_dist(tmpdir): pass + def test_dash_to_underscore_warning(self, tmpdir): + # dash_to_underscore_warning() is a method in setuptools.dist + # remove this test and method when dash convert to underscore in setup.cfg + # is no longer supported + fake_env( + tmpdir, + '[metadata]\n' + 'author-email = test@test.com\n' + 'maintainer_email = foo@foo.com\n' + ) + msg = ("Usage of dash-separated 'author-email' will not be supported " + "in future versions. " + "Please use the underscore name 'author_email' instead") + with pytest.warns(UserWarning, match=msg): + with get_dist(tmpdir) as dist: + metadata = dist.metadata + assert metadata.author_email == 'test@test.com' + assert metadata.maintainer_email == 'foo@foo.com' + class TestOptions: |
