diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2020-03-15 22:08:36 -0400 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2020-03-15 22:14:35 -0400 |
commit | 0e1c968f36a5d6cf268fe3f1ffca9405bb99e20d (patch) | |
tree | 1f75001b629a1c1a8fa5bf5bde95fb45ba2b601b /setuptools/tests | |
parent | b43c5b81b76d687b50b05f05155838c69919c42c (diff) | |
download | external_python_setuptools-0e1c968f36a5d6cf268fe3f1ffca9405bb99e20d.tar.gz external_python_setuptools-0e1c968f36a5d6cf268fe3f1ffca9405bb99e20d.tar.bz2 external_python_setuptools-0e1c968f36a5d6cf268fe3f1ffca9405bb99e20d.zip |
Trim up syntax on test cases, including removing hanging indents.
Diffstat (limited to 'setuptools/tests')
-rw-r--r-- | setuptools/tests/test_dist.py | 110 |
1 files changed, 54 insertions, 56 deletions
diff --git a/setuptools/tests/test_dist.py b/setuptools/tests/test_dist.py index 97055d97..47c2de3e 100644 --- a/setuptools/tests/test_dist.py +++ b/setuptools/tests/test_dist.py @@ -70,71 +70,69 @@ def test_dist__get_unpatched_deprecated(): def __read_test_cases(): - # Metadata version 1.0 - base_attrs = { - "name": "package", - "version": "0.0.1", - "author": "Foo Bar", - "author_email": "foo@bar.net", - "long_description": "Long\ndescription", - "description": "Short description", - "keywords": ["one", "two"] - } - - def merge_dicts(d1, d2): - d1 = d1.copy() - d1.update(d2) - - return d1 + base = dict( + name="package", + version="0.0.1", + author="Foo Bar", + author_email="foo@bar.net", + long_description="Long\ndescription", + description="Short description", + keywords=["one", "two"], + ) + + def params(**update): + return dict(base, **update) test_cases = [ - ('Metadata version 1.0', base_attrs.copy()), - ('Metadata version 1.1: Provides', merge_dicts(base_attrs, { - 'provides': ['package'] - })), - ('Metadata version 1.1: Obsoletes', merge_dicts(base_attrs, { - 'obsoletes': ['foo'] - })), - ('Metadata version 1.1: Classifiers', merge_dicts(base_attrs, { - 'classifiers': [ + ('Metadata version 1.0', params()), + ('Metadata version 1.1: Provides', params( + provides=['package'], + )), + ('Metadata version 1.1: Obsoletes', params( + obsoletes=['foo'], + )), + ('Metadata version 1.1: Classifiers', params( + classifiers=[ 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.7', 'License :: OSI Approved :: MIT License', - ]})), - ('Metadata version 1.1: Download URL', merge_dicts(base_attrs, { - 'download_url': 'https://example.com' - })), - ('Metadata Version 1.2: Requires-Python', merge_dicts(base_attrs, { - 'python_requires': '>=3.7' - })), + ], + )), + ('Metadata version 1.1: Download URL', params( + download_url='https://example.com', + )), + ('Metadata Version 1.2: Requires-Python', params( + python_requires='>=3.7', + )), pytest.param( 'Metadata Version 1.2: Project-Url', - merge_dicts(base_attrs, { - 'project_urls': { - 'Foo': 'https://example.bar' - } - }), marks=pytest.mark.xfail( - reason="Issue #1578: project_urls not read" - )), - ('Metadata Version 2.1: Long Description Content Type', - merge_dicts(base_attrs, { - 'long_description_content_type': 'text/x-rst; charset=UTF-8' - })), + params(project_urls=dict(Foo='https://example.bar')), + marks=pytest.mark.xfail( + reason="Issue #1578: project_urls not read", + ), + ), + ('Metadata Version 2.1: Long Description Content Type', params( + long_description_content_type='text/x-rst; charset=UTF-8', + )), pytest.param( 'Metadata Version 2.1: Provides Extra', - merge_dicts(base_attrs, { - 'provides_extras': ['foo', 'bar'] - }), marks=pytest.mark.xfail(reason="provides_extras not read")), - ('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 and e-mail', - {'name': 'foo', 'version': '1.0.0'}), + params(provides_extras=['foo', 'bar']), + marks=pytest.mark.xfail(reason="provides_extras not read"), + ), + ('Missing author', dict( + name='foo', + version='1.0.0', + author_email='snorri@sturluson.name', + )), + ('Missing author e-mail', dict( + name='foo', + version='1.0.0', + author='Snorri Sturluson', + )), + ('Missing author and e-mail', dict( + name='foo', + version='1.0.0', + )), ] return test_cases |