summaryrefslogtreecommitdiff
path: root/setuptools/_distutils/tests/test_check.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2022-05-09 10:42:04 -0400
committerJason R. Coombs <jaraco@jaraco.com>2022-05-09 10:42:56 -0400
commit9116c7eb52504bec77d26881d2c28e427dc52143 (patch)
tree6becb88401eb15bdff6fc924211894e6d9c277d1 /setuptools/_distutils/tests/test_check.py
parent8d12d6196c369c7cf0164a1202e968dd68a2cb6c (diff)
parente009a87b5578cb16099b697ba8395c8f6bdd70f3 (diff)
downloadpython-setuptools-git-debt/remove-easy-install.tar.gz
Merge branch 'main' into debt/remove-easy-installdebt/remove-easy-install
Diffstat (limited to 'setuptools/_distutils/tests/test_check.py')
-rw-r--r--setuptools/_distutils/tests/test_check.py24
1 files changed, 23 insertions, 1 deletions
diff --git a/setuptools/_distutils/tests/test_check.py b/setuptools/_distutils/tests/test_check.py
index e534aca1..b41dba3d 100644
--- a/setuptools/_distutils/tests/test_check.py
+++ b/setuptools/_distutils/tests/test_check.py
@@ -71,6 +71,28 @@ class CheckTestCase(support.LoggingSilencer,
cmd = self._run(metadata)
self.assertEqual(cmd._warnings, 0)
+ def test_check_author_maintainer(self):
+ for kind in ("author", "maintainer"):
+ # ensure no warning when author_email or maintainer_email is given
+ # (the spec allows these fields to take the form "Name <email>")
+ metadata = {'url': 'xxx',
+ kind + '_email': 'Name <name@email.com>',
+ 'name': 'xxx', 'version': 'xxx'}
+ cmd = self._run(metadata)
+ self.assertEqual(cmd._warnings, 0)
+
+ # the check should warn if only email is given and it does not
+ # contain the name
+ metadata[kind + '_email'] = 'name@email.com'
+ cmd = self._run(metadata)
+ self.assertEqual(cmd._warnings, 1)
+
+ # the check should warn if only the name is given
+ metadata[kind] = "Name"
+ del metadata[kind + '_email']
+ cmd = self._run(metadata)
+ self.assertEqual(cmd._warnings, 1)
+
@unittest.skipUnless(HAS_DOCUTILS, "won't test without docutils")
def test_check_document(self):
pkg_info, dist = self.create_dist()
@@ -157,7 +179,7 @@ class CheckTestCase(support.LoggingSilencer,
'restructuredtext': 1})
def test_suite():
- return unittest.makeSuite(CheckTestCase)
+ return unittest.TestLoader().loadTestsFromTestCase(CheckTestCase)
if __name__ == "__main__":
run_unittest(test_suite())