summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_importlib
diff options
context:
space:
mode:
authorBrett Cannon <brettcannon@users.noreply.github.com>2018-04-30 18:31:45 (GMT)
committerGitHub <noreply@github.com>2018-04-30 18:31:45 (GMT)
commit3ab9365dca8438f89b2060cd3eebe00606133dc4 (patch)
tree7844d510039f747edd6ed5cb2b1e60977c20a30a /Lib/test/test_importlib
parent10f715d71218ece737f990fa55027b8e1120cc3a (diff)
downloadcpython-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.py7
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(