From ac3cee396ff93f66afa86bc6e3aa3da3a2667514 Mon Sep 17 00:00:00 2001 From: Paul Ganssle Date: Mon, 12 Nov 2018 22:32:51 -0500 Subject: Fix issue with missing author metadata Prior to this patch, if the author or author_email were omitted from `setup`, a malformed `PKG-INFO` would be created. --- setuptools/tests/test_dist.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'setuptools/tests/test_dist.py') diff --git a/setuptools/tests/test_dist.py b/setuptools/tests/test_dist.py index a7f4452b..170d27ed 100644 --- a/setuptools/tests/test_dist.py +++ b/setuptools/tests/test_dist.py @@ -115,6 +115,20 @@ def __read_test_cases(): merge_dicts(base_attrs, { 'provides_extras': ['foo', 'bar'] }), marks=pytest.mark.xfail(reason="provides_extras not read")), + ('Missing author, missing author e-mail', + {'name': 'foo', 'version': '1.0.0'}), + ('Missing author', + {'name': 'foo', + 'version': '1.0.0', + 'author_email': 'snorri@sturluson.name'}), + ('Missing author e-mail', + {'name': 'foo', + 'version': '1.0.0', + 'author': 'Snorri Sturluson'}), + ('Missing author', + {'name': 'foo', + 'version': '1.0.0', + 'author': 'Snorri Sturluson'}), ] return test_cases @@ -141,6 +155,8 @@ def test_read_metadata(name, attrs): tested_attrs = [ ('name', dist_class.get_name), ('version', dist_class.get_version), + ('author', dist_class.get_contact), + ('author_email', dist_class.get_contact_email), ('metadata_version', dist_class.get_metadata_version), ('provides', dist_class.get_provides), ('description', dist_class.get_description), -- cgit v1.2.3