diff options
author | Nikita Sobolev <mail@sobolevn.me> | 2022-01-18 19:28:18 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-18 19:28:18 (GMT) |
commit | 1292aa6db5bed889a3c87df443754fcae0177801 (patch) | |
tree | 131eec842d87333ea97fcb90cb58764ac4652c56 /Lib | |
parent | ff7703c4b609a697ada8165fd1c52a73404b6d07 (diff) | |
download | cpython-1292aa6db5bed889a3c87df443754fcae0177801.zip cpython-1292aa6db5bed889a3c87df443754fcae0177801.tar.gz cpython-1292aa6db5bed889a3c87df443754fcae0177801.tar.bz2 |
bpo-46425: Fix direct invocation of multiple test modules (GH-30666)
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_compileall.py | 6 | ||||
-rw-r--r-- | Lib/test/test_distutils.py | 2 | ||||
-rw-r--r-- | Lib/test/test_dtrace.py | 2 | ||||
-rw-r--r-- | Lib/test/test_tools/test_freeze.py | 2 | ||||
-rw-r--r-- | Lib/test/test_zipfile64.py | 3 | ||||
-rw-r--r-- | Lib/unittest/test/test_program.py | 2 |
6 files changed, 8 insertions, 9 deletions
diff --git a/Lib/test/test_compileall.py b/Lib/test/test_compileall.py index 9e15ecf..33f0c93 100644 --- a/Lib/test/test_compileall.py +++ b/Lib/test/test_compileall.py @@ -3,7 +3,6 @@ import contextlib import filecmp import importlib.util import io -import itertools import os import pathlib import py_compile @@ -29,9 +28,8 @@ except NotImplementedError: from test import support from test.support import os_helper from test.support import script_helper - -from .test_py_compile import without_source_date_epoch -from .test_py_compile import SourceDateEpochTestMeta +from test.test_py_compile import without_source_date_epoch +from test.test_py_compile import SourceDateEpochTestMeta def get_pyc(script, opt): diff --git a/Lib/test/test_distutils.py b/Lib/test/test_distutils.py index 4b40af0..d82d2b6 100644 --- a/Lib/test/test_distutils.py +++ b/Lib/test/test_distutils.py @@ -5,7 +5,7 @@ the test_suite() function there returns a test suite that's ready to be run. """ -import warnings +import unittest from test import support from test.support import warnings_helper diff --git a/Lib/test/test_dtrace.py b/Lib/test/test_dtrace.py index 3957077..8a436ad 100644 --- a/Lib/test/test_dtrace.py +++ b/Lib/test/test_dtrace.py @@ -170,4 +170,4 @@ class SystemTapOptimizedTests(TraceTests, unittest.TestCase): if __name__ == '__main__': - test_main() + unittest.main() diff --git a/Lib/test/test_tools/test_freeze.py b/Lib/test/test_tools/test_freeze.py index 386c35a..cca3c47 100644 --- a/Lib/test/test_tools/test_freeze.py +++ b/Lib/test/test_tools/test_freeze.py @@ -6,8 +6,8 @@ import unittest from test import support from test.support import os_helper +from test.test_tools import imports_under_tool, skip_if_missing -from . import imports_under_tool, skip_if_missing skip_if_missing('freeze') with imports_under_tool('freeze', 'test'): import freeze as helper diff --git a/Lib/test/test_zipfile64.py b/Lib/test/test_zipfile64.py index 810fded..0947013a 100644 --- a/Lib/test/test_zipfile64.py +++ b/Lib/test/test_zipfile64.py @@ -18,8 +18,9 @@ import sys from tempfile import TemporaryFile from test.support import os_helper -from test.support import TESTFN, requires_zlib +from test.support import requires_zlib +TESTFN = os_helper.TESTFN TESTFN2 = TESTFN + "2" # How much time in seconds can pass before we print a 'Still working' message. diff --git a/Lib/unittest/test/test_program.py b/Lib/unittest/test/test_program.py index f7049fb..687f629 100644 --- a/Lib/unittest/test/test_program.py +++ b/Lib/unittest/test/test_program.py @@ -6,7 +6,7 @@ import subprocess from test import support import unittest import unittest.test -from .test_result import BufferedWriter +from unittest.test.test_result import BufferedWriter class Test_TestProgram(unittest.TestCase): |