mirror of
https://github.com/python/cpython.git
synced 2025-11-25 21:11:09 +00:00
bpo-33254: do not return an empty list when asking for the contents of a namespace package (GH-6467)
This commit is contained in:
parent
10f715d712
commit
3ab9365dca
5 changed files with 22 additions and 21 deletions
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue