summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_importlib/util.py
diff options
context:
space:
mode:
authorHai Shi <shihai1992@gmail.com>2020-08-04 15:53:12 (GMT)
committerGitHub <noreply@github.com>2020-08-04 15:53:12 (GMT)
commitc7decc27d529c04a4e6b2922e3f3f9419b920f63 (patch)
tree9bcb971af68ed2e08f4aa4001412d38520194cff /Lib/test/test_importlib/util.py
parent604bba1f8fe32479c89b9824b2231cc4480dd110 (diff)
downloadcpython-c7decc27d529c04a4e6b2922e3f3f9419b920f63.zip
cpython-c7decc27d529c04a4e6b2922e3f3f9419b920f63.tar.gz
cpython-c7decc27d529c04a4e6b2922e3f3f9419b920f63.tar.bz2
bpo-40275: Use new test.support helper submodules in tests (GH-21727)
Diffstat (limited to 'Lib/test/test_importlib/util.py')
-rw-r--r--Lib/test/test_importlib/util.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/Lib/test/test_importlib/util.py b/Lib/test/test_importlib/util.py
index 2745c9b..5c0375e 100644
--- a/Lib/test/test_importlib/util.py
+++ b/Lib/test/test_importlib/util.py
@@ -13,6 +13,7 @@ import os.path
from pathlib import Path, PurePath
from test import support
from test.support import import_helper
+from test.support import os_helper
import unittest
import sys
import tempfile
@@ -159,9 +160,9 @@ def uncache(*names):
@contextlib.contextmanager
def temp_module(name, content='', *, pkg=False):
conflicts = [n for n in sys.modules if n.partition('.')[0] == name]
- with support.temp_cwd(None) as cwd:
+ with os_helper.temp_cwd(None) as cwd:
with uncache(name, *conflicts):
- with support.DirsOnSysPath(cwd):
+ with import_helper.DirsOnSysPath(cwd):
invalidate_caches()
location = os.path.join(cwd, name)
@@ -397,7 +398,7 @@ def create_modules(*names):
state_manager.__exit__(None, None, None)
if uncache_manager is not None:
uncache_manager.__exit__(None, None, None)
- support.rmtree(temp_dir)
+ os_helper.rmtree(temp_dir)
def mock_path_hook(*entries, importer):
@@ -573,8 +574,8 @@ class ZipSetupBase:
pass
def setUp(self):
- modules = support.modules_setup()
- self.addCleanup(support.modules_cleanup, *modules)
+ modules = import_helper.modules_setup()
+ self.addCleanup(import_helper.modules_cleanup, *modules)
class ZipSetup(ZipSetupBase):