From a9f8179e1879785231b95a5a4b6b1c08b1019af5 Mon Sep 17 00:00:00 2001 From: Dan Rose Date: Thu, 19 Sep 2019 15:46:56 -0500 Subject: [PATCH] Add a test for setup.py with no name --- test/test_package_identification_python.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/test_package_identification_python.py b/test/test_package_identification_python.py index 254daf8f..3acdaa66 100644 --- a/test/test_package_identification_python.py +++ b/test/test_package_identification_python.py @@ -60,6 +60,15 @@ def test_empty_setup_py(unchanged_empty_descriptor): assert e.match('not a Distutils setup script') +@pytest.mark.xfail +def test_setup_py_no_name(unchanged_empty_descriptor): + extension = PythonPackageIdentification() + (unchanged_empty_descriptor.path / 'setup.py').write_text( + 'import setuptools; setuptools.setup(name="")') + with pytest.raises(RuntimeError): + extension.identify(unchanged_empty_descriptor) + + def test_re_identify_if_non_python_package(package_descriptor): package_descriptor.name = 'other-package' package_descriptor.type = 'other'