mirror of
https://github.com/python/cpython.git
synced 2026-04-22 03:41:08 +00:00
bpo-33755: Fix importlib.resources isolation tests (GH-7412) (#7434)
(cherry picked from commit ac1ee1bada)
Co-authored-by: Barry Warsaw <barry@python.org>
This commit is contained in:
parent
1d419faccd
commit
e135032ffa
2 changed files with 9 additions and 1 deletions
|
|
@ -2,7 +2,7 @@
|
|||
import unittest
|
||||
|
||||
from . import data01
|
||||
from . import zipdata02
|
||||
from . import zipdata01, zipdata02
|
||||
from . import util
|
||||
from importlib import resources, import_module
|
||||
|
||||
|
|
@ -109,6 +109,10 @@ def test_unrelated_contents(self):
|
|||
set(resources.contents('ziptestdata.two')),
|
||||
{'__init__.py', 'resource2.txt'})
|
||||
|
||||
|
||||
class SubdirectoryResourceFromZipsTest(util.ZipSetupBase, unittest.TestCase):
|
||||
ZIP_MODULE = zipdata01 # type: ignore
|
||||
|
||||
def test_is_submodule_resource(self):
|
||||
submodule = import_module('ziptestdata.subdirectory')
|
||||
self.assertTrue(
|
||||
|
|
|
|||
|
|
@ -549,6 +549,10 @@ def tearDownClass(cls):
|
|||
except AttributeError:
|
||||
pass
|
||||
|
||||
def setUp(self):
|
||||
modules = support.modules_setup()
|
||||
self.addCleanup(support.modules_cleanup, *modules)
|
||||
|
||||
|
||||
class ZipSetup(ZipSetupBase):
|
||||
ZIP_MODULE = zipdata01 # type: ignore
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue