diff options
author | Brett Cannon <brettcannon@users.noreply.github.com> | 2018-04-30 18:31:45 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-30 18:31:45 (GMT) |
commit | 3ab9365dca8438f89b2060cd3eebe00606133dc4 (patch) | |
tree | 7844d510039f747edd6ed5cb2b1e60977c20a30a /Lib/test/test_importlib | |
parent | 10f715d71218ece737f990fa55027b8e1120cc3a (diff) | |
download | cpython-3ab9365dca8438f89b2060cd3eebe00606133dc4.zip cpython-3ab9365dca8438f89b2060cd3eebe00606133dc4.tar.gz cpython-3ab9365dca8438f89b2060cd3eebe00606133dc4.tar.bz2 |
bpo-33254: do not return an empty list when asking for the contents of a namespace package (GH-6467)
Diffstat (limited to 'Lib/test/test_importlib')
-rw-r--r-- | Lib/test/test_importlib/test_resource.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Lib/test/test_importlib/test_resource.py b/Lib/test/test_importlib/test_resource.py index d717e1d..b076860 100644 --- a/Lib/test/test_importlib/test_resource.py +++ b/Lib/test/test_importlib/test_resource.py @@ -131,10 +131,9 @@ class ResourceFromZipsTest(util.ZipSetupBase, unittest.TestCase): class NamespaceTest(unittest.TestCase): - def test_namespaces_cant_have_resources(self): - contents = set(resources.contents( - 'test.test_importlib.data03.namespace')) - self.assertEqual(len(contents), 0) + def test_namespaces_cannot_have_resources(self): + contents = resources.contents('test.test_importlib.data03.namespace') + self.assertFalse(list(contents)) # Even though there is a file in the namespace directory, it is not # considered a resource, since namespace packages can't have them. self.assertFalse(resources.is_resource( |