summaryrefslogtreecommitdiff
path: root/setuptools/tests
diff options
context:
space:
mode:
authorMelissa Li <li.melissa.kun@gmail.com>2021-03-02 22:54:53 -0500
committerMelissa Li <li.melissa.kun@gmail.com>2021-03-02 22:54:53 -0500
commit08d6a2f2b0fb4b57f749d0adaaca3efc158419cd (patch)
tree5a67a63d82f08fd65bcbeb0f9e49ab556d9734b8 /setuptools/tests
parentd027d6d2140daf87079dd3bd186585a5b063269e (diff)
downloadpython-setuptools-git-08d6a2f2b0fb4b57f749d0adaaca3efc158419cd.tar.gz
Add test for conversion warning
Diffstat (limited to 'setuptools/tests')
-rw-r--r--setuptools/tests/test_config.py19
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: