diff options
Diffstat (limited to 'Lib/test/libregrtest')
-rw-r--r-- | Lib/test/libregrtest/main.py | 3 | ||||
-rw-r--r-- | Lib/test/libregrtest/runtest.py | 6 | ||||
-rw-r--r-- | Lib/test/libregrtest/save_env.py | 3 |
3 files changed, 8 insertions, 4 deletions
diff --git a/Lib/test/libregrtest/main.py b/Lib/test/libregrtest/main.py index adf31cc..3f9771b 100644 --- a/Lib/test/libregrtest/main.py +++ b/Lib/test/libregrtest/main.py @@ -20,6 +20,7 @@ from test.libregrtest.setup import setup_tests from test.libregrtest.pgo import setup_pgo_tests from test.libregrtest.utils import removepy, count, format_duration, printlist from test import support +from test.support import os_helper # bpo-38203: Maximum delay in seconds to exit Python (call Py_Finalize()). @@ -628,7 +629,7 @@ class Regrtest: # to a temporary and writable directory. If it's not possible to # create or change the CWD, the original CWD will be used. # The original CWD is available from support.SAVEDCWD. - with support.temp_cwd(test_cwd, quiet=True): + with os_helper.temp_cwd(test_cwd, quiet=True): # When using multiprocessing, worker processes will use test_cwd # as their parent temporary directory. So when the main process # exit, it removes also subdirectories of worker processes. diff --git a/Lib/test/libregrtest/runtest.py b/Lib/test/libregrtest/runtest.py index 9338b28..e46cc31 100644 --- a/Lib/test/libregrtest/runtest.py +++ b/Lib/test/libregrtest/runtest.py @@ -11,6 +11,8 @@ import traceback import unittest from test import support +from test.support import import_helper +from test.support import os_helper from test.libregrtest.refleak import dash_R, clear_caches from test.libregrtest.save_env import saved_test_environment from test.libregrtest.utils import format_duration, print_warning @@ -216,7 +218,7 @@ def _runtest_inner2(ns, test_name): abstest = get_abs_module(ns, test_name) # remove the module from sys.module to reload it if it was already imported - support.unload(abstest) + import_helper.unload(abstest) the_module = importlib.import_module(abstest) @@ -313,7 +315,7 @@ def cleanup_test_droppings(test_name, verbose): # since if a test leaves a file open, it cannot be deleted by name (while # there's nothing we can do about that here either, we can display the # name of the offending test, which is a real help). - for name in (support.TESTFN,): + for name in (os_helper.TESTFN,): if not os.path.exists(name): continue diff --git a/Lib/test/libregrtest/save_env.py b/Lib/test/libregrtest/save_env.py index e7c27a6..50ed353 100644 --- a/Lib/test/libregrtest/save_env.py +++ b/Lib/test/libregrtest/save_env.py @@ -10,6 +10,7 @@ import threading import urllib.request import warnings from test import support +from test.support import os_helper from test.libregrtest.utils import print_warning try: import _multiprocessing, multiprocessing.process @@ -241,7 +242,7 @@ class saved_test_environment: return sorted(fn + ('/' if os.path.isdir(fn) else '') for fn in os.listdir()) def restore_files(self, saved_value): - fn = support.TESTFN + fn = os_helper.TESTFN if fn not in saved_value and (fn + '/') not in saved_value: if os.path.isfile(fn): support.unlink(fn) |