bpo-46425: Fix direct invocation of multiple test modules (GH-30666)

This commit is contained in:
Nikita Sobolev 2022-01-18 22:28:18 +03:00 committed by GitHub
parent ff7703c4b6
commit 1292aa6db5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 8 additions and 9 deletions

View File

@ -3,7 +3,6 @@ import contextlib
import filecmp import filecmp
import importlib.util import importlib.util
import io import io
import itertools
import os import os
import pathlib import pathlib
import py_compile import py_compile
@ -29,9 +28,8 @@ except NotImplementedError:
from test import support from test import support
from test.support import os_helper from test.support import os_helper
from test.support import script_helper from test.support import script_helper
from test.test_py_compile import without_source_date_epoch
from .test_py_compile import without_source_date_epoch from test.test_py_compile import SourceDateEpochTestMeta
from .test_py_compile import SourceDateEpochTestMeta
def get_pyc(script, opt): def get_pyc(script, opt):

View File

@ -5,7 +5,7 @@ the test_suite() function there returns a test suite that's ready to
be run. be run.
""" """
import warnings import unittest
from test import support from test import support
from test.support import warnings_helper from test.support import warnings_helper

View File

@ -170,4 +170,4 @@ class SystemTapOptimizedTests(TraceTests, unittest.TestCase):
if __name__ == '__main__': if __name__ == '__main__':
test_main() unittest.main()

View File

@ -6,8 +6,8 @@ import unittest
from test import support from test import support
from test.support import os_helper 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') skip_if_missing('freeze')
with imports_under_tool('freeze', 'test'): with imports_under_tool('freeze', 'test'):
import freeze as helper import freeze as helper

View File

@ -18,8 +18,9 @@ import sys
from tempfile import TemporaryFile from tempfile import TemporaryFile
from test.support import os_helper 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" TESTFN2 = TESTFN + "2"
# How much time in seconds can pass before we print a 'Still working' message. # How much time in seconds can pass before we print a 'Still working' message.

View File

@ -6,7 +6,7 @@ import subprocess
from test import support from test import support
import unittest import unittest
import unittest.test import unittest.test
from .test_result import BufferedWriter from unittest.test.test_result import BufferedWriter
class Test_TestProgram(unittest.TestCase): class Test_TestProgram(unittest.TestCase):