diff --git a/Lib/test/__main__.py b/Lib/test/__main__.py index 19a6b2b8904526a..e5780b784b4b053 100644 --- a/Lib/test/__main__.py +++ b/Lib/test/__main__.py @@ -1,2 +1,2 @@ -from test.libregrtest import main +from test.libregrtest.main import main main() diff --git a/Lib/test/autotest.py b/Lib/test/autotest.py index fa85cc153a133aa..b5a1fab404c72d7 100644 --- a/Lib/test/autotest.py +++ b/Lib/test/autotest.py @@ -1,5 +1,5 @@ # This should be equivalent to running regrtest.py from the cmdline. # It can be especially handy if you're in an interactive shell, e.g., # from test import autotest. -from test.libregrtest import main +from test.libregrtest.main import main main() diff --git a/Lib/test/libregrtest/__init__.py b/Lib/test/libregrtest/__init__.py index 5e8dba5dbde71a2..e69de29bb2d1d64 100644 --- a/Lib/test/libregrtest/__init__.py +++ b/Lib/test/libregrtest/__init__.py @@ -1,2 +0,0 @@ -from test.libregrtest.cmdline import _parse_args, RESOURCE_NAMES, ALL_RESOURCES -from test.libregrtest.main import main diff --git a/Lib/test/libregrtest/findtests.py b/Lib/test/libregrtest/findtests.py index 88570be7dccdfd6..0d38b8e60eb7223 100644 --- a/Lib/test/libregrtest/findtests.py +++ b/Lib/test/libregrtest/findtests.py @@ -1,6 +1,6 @@ import os -from test.libregrtest.utils import StrPath, TestName, TestList +from .utils import StrPath, TestName, TestList # If these test directories are encountered recurse into them and treat each diff --git a/Lib/test/libregrtest/logger.py b/Lib/test/libregrtest/logger.py index 6195b5ddd4ebc03..f74bdff6322f13b 100644 --- a/Lib/test/libregrtest/logger.py +++ b/Lib/test/libregrtest/logger.py @@ -1,12 +1,12 @@ import os import time -from test.libregrtest.results import TestResults -from test.libregrtest.runtests import RunTests -from test.libregrtest.utils import print_warning, MS_WINDOWS +from .results import TestResults +from .runtests import RunTests +from .utils import print_warning, MS_WINDOWS if MS_WINDOWS: - from test.libregrtest.win_utils import WindowsLoadTracker + from .win_utils import WindowsLoadTracker class Logger: diff --git a/Lib/test/libregrtest/main.py b/Lib/test/libregrtest/main.py index 31eab99ca763511..0f289c06325bd00 100644 --- a/Lib/test/libregrtest/main.py +++ b/Lib/test/libregrtest/main.py @@ -10,16 +10,16 @@ from test import support from test.support import os_helper -from test.libregrtest.cmdline import _parse_args, Namespace -from test.libregrtest.findtests import findtests, split_test_packages -from test.libregrtest.logger import Logger -from test.libregrtest.result import State -from test.libregrtest.runtests import RunTests, HuntRefleak -from test.libregrtest.setup import setup_process, setup_test_dir -from test.libregrtest.single import run_single_test, PROGRESS_MIN_TIME -from test.libregrtest.pgo import setup_pgo_tests -from test.libregrtest.results import TestResults -from test.libregrtest.utils import ( +from .cmdline import _parse_args, Namespace +from .findtests import findtests, split_test_packages +from .logger import Logger +from .result import State +from .runtests import RunTests, HuntRefleak +from .setup import setup_process, setup_test_dir +from .single import run_single_test, PROGRESS_MIN_TIME +from .pgo import setup_pgo_tests +from .results import TestResults +from .utils import ( StrPath, StrJSON, TestName, TestList, TestTuple, FilterTuple, strip_py_suffix, count, format_duration, printlist, get_build_info, get_temp_dir, get_work_dir, exit_timeout, @@ -409,7 +409,7 @@ def get_state(self): return state def _run_tests_mp(self, runtests: RunTests, num_workers: int) -> None: - from test.libregrtest.run_workers import RunWorkers + from .run_workers import RunWorkers RunWorkers(num_workers, runtests, self.logger, self.results).run() def finalize_tests(self, tracer): diff --git a/Lib/test/libregrtest/refleak.py b/Lib/test/libregrtest/refleak.py index 6b1d7082ba46ba3..edf8569a8f95fd0 100644 --- a/Lib/test/libregrtest/refleak.py +++ b/Lib/test/libregrtest/refleak.py @@ -5,8 +5,8 @@ from test import support from test.support import os_helper -from test.libregrtest.runtests import HuntRefleak -from test.libregrtest.utils import clear_caches +from .runtests import HuntRefleak +from .utils import clear_caches try: from _abc import _get_dump diff --git a/Lib/test/libregrtest/result.py b/Lib/test/libregrtest/result.py index b73494d07583fc7..cfd08ecc41b7d45 100644 --- a/Lib/test/libregrtest/result.py +++ b/Lib/test/libregrtest/result.py @@ -4,7 +4,7 @@ from test.support import TestStats -from test.libregrtest.utils import ( +from .utils import ( StrJSON, TestName, FilterTuple, format_duration, normalize_test_name, print_warning) diff --git a/Lib/test/libregrtest/results.py b/Lib/test/libregrtest/results.py index 6a07c2fcf3092cf..94654fd6ab23f9c 100644 --- a/Lib/test/libregrtest/results.py +++ b/Lib/test/libregrtest/results.py @@ -1,9 +1,9 @@ import sys from test.support import TestStats -from test.libregrtest.runtests import RunTests -from test.libregrtest.result import State, TestResult -from test.libregrtest.utils import ( +from .runtests import RunTests +from .result import State, TestResult +from .utils import ( StrPath, TestName, TestTuple, TestList, FilterDict, printlist, count, format_duration) diff --git a/Lib/test/libregrtest/run_workers.py b/Lib/test/libregrtest/run_workers.py index 6267fe5a924d9f4..768625cb507f9af 100644 --- a/Lib/test/libregrtest/run_workers.py +++ b/Lib/test/libregrtest/run_workers.py @@ -14,15 +14,15 @@ from test import support from test.support import os_helper -from test.libregrtest.logger import Logger -from test.libregrtest.result import TestResult, State -from test.libregrtest.results import TestResults -from test.libregrtest.runtests import RunTests -from test.libregrtest.single import PROGRESS_MIN_TIME -from test.libregrtest.utils import ( +from .logger import Logger +from .result import TestResult, State +from .results import TestResults +from .runtests import RunTests +from .single import PROGRESS_MIN_TIME +from .utils import ( StrPath, TestName, format_duration, print_warning) -from test.libregrtest.worker import create_worker_process, USE_PROCESS_GROUP +from .worker import create_worker_process, USE_PROCESS_GROUP if sys.platform == 'win32': import locale diff --git a/Lib/test/libregrtest/runtests.py b/Lib/test/libregrtest/runtests.py index e16e79e990c8f1b..e843cc2dadf7346 100644 --- a/Lib/test/libregrtest/runtests.py +++ b/Lib/test/libregrtest/runtests.py @@ -2,7 +2,7 @@ import json from typing import Any -from test.libregrtest.utils import ( +from .utils import ( StrPath, StrJSON, TestTuple, FilterTuple, FilterDict) diff --git a/Lib/test/libregrtest/save_env.py b/Lib/test/libregrtest/save_env.py index 164fe9806b5f0dc..55c1f7801489b01 100644 --- a/Lib/test/libregrtest/save_env.py +++ b/Lib/test/libregrtest/save_env.py @@ -3,9 +3,11 @@ import os import sys import threading + from test import support from test.support import os_helper -from test.libregrtest.utils import print_warning + +from .utils import print_warning class SkipTestEnvironment(Exception): diff --git a/Lib/test/libregrtest/setup.py b/Lib/test/libregrtest/setup.py index c3d812731638600..353a0f70b94ab2d 100644 --- a/Lib/test/libregrtest/setup.py +++ b/Lib/test/libregrtest/setup.py @@ -10,8 +10,8 @@ except ImportError: gc = None -from test.libregrtest.runtests import RunTests -from test.libregrtest.utils import ( +from .runtests import RunTests +from .utils import ( setup_unraisable_hook, setup_threading_excepthook, fix_umask, replace_stdout, adjust_rlimit_nofile) diff --git a/Lib/test/libregrtest/single.py b/Lib/test/libregrtest/single.py index 0cb319257878939..635b4f93702b04c 100644 --- a/Lib/test/libregrtest/single.py +++ b/Lib/test/libregrtest/single.py @@ -12,11 +12,11 @@ from test.support import TestStats from test.support import threading_helper -from test.libregrtest.result import State, TestResult -from test.libregrtest.runtests import RunTests -from test.libregrtest.save_env import saved_test_environment -from test.libregrtest.setup import setup_tests -from test.libregrtest.utils import ( +from .result import State, TestResult +from .runtests import RunTests +from .save_env import saved_test_environment +from .setup import setup_tests +from .utils import ( TestName, clear_caches, remove_testfn, abs_module_name, print_warning) @@ -40,7 +40,7 @@ def regrtest_runner(result: TestResult, test_func, runtests: RunTests) -> None: # Run test_func(), collect statistics, and detect reference and memory # leaks. if runtests.hunt_refleak: - from test.libregrtest.refleak import runtest_refleak + from .refleak import runtest_refleak refleak, test_result = runtest_refleak(result.test_name, test_func, runtests.hunt_refleak, runtests.quiet) diff --git a/Lib/test/libregrtest/worker.py b/Lib/test/libregrtest/worker.py index b9fb031764349a9..ed1286e5700679c 100644 --- a/Lib/test/libregrtest/worker.py +++ b/Lib/test/libregrtest/worker.py @@ -6,10 +6,10 @@ from test import support from test.support import os_helper -from test.libregrtest.setup import setup_process, setup_test_dir -from test.libregrtest.runtests import RunTests -from test.libregrtest.single import run_single_test -from test.libregrtest.utils import ( +from .setup import setup_process, setup_test_dir +from .runtests import RunTests +from .single import run_single_test +from .utils import ( StrPath, StrJSON, FilterTuple, get_work_dir, exit_timeout) diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py index 0ffb3ed454eda07..46a74fe276f5530 100755 --- a/Lib/test/regrtest.py +++ b/Lib/test/regrtest.py @@ -8,7 +8,7 @@ import os import sys -from test.libregrtest import main +from test.libregrtest.main import main # Alias for backward compatibility (just in case)