Skip to content

Commit 302756c

Browse files
committed
Revert more imports
1 parent 4be7293 commit 302756c

File tree

3 files changed

+13
-14
lines changed

3 files changed

+13
-14
lines changed

Lib/test/test_regrtest.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
from xml.etree import ElementTree
2727

2828
from test import support
29-
from test.support import force_not_colorized_test_class
3029
from test.support import import_helper
3130
from test.support import os_helper
3231
from test.libregrtest import cmdline
@@ -793,7 +792,7 @@ def test_finds_expected_number_of_tests(self):
793792
f'{", ".join(output.splitlines())}')
794793

795794

796-
@force_not_colorized_test_class
795+
@support.force_not_colorized_test_class
797796
class ProgramsTestCase(BaseTestCase):
798797
"""
799798
Test various ways to run the Python test suite. Use options close
@@ -907,7 +906,7 @@ def test_pcbuild_rt(self):
907906
self.run_batch(script, *rt_args, *self.regrtest_args, *self.tests)
908907

909908

910-
@force_not_colorized_test_class
909+
@support.force_not_colorized_test_class
911910
class ArgsTestCase(BaseTestCase):
912911
"""
913912
Test arguments of the Python test suite.

Lib/test/test_repl.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
from test import support
1010
from test.support import (
1111
cpython_only,
12-
force_not_colorized_test_class,
1312
has_subprocess_support,
1413
os_helper,
1514
SuppressCrashReport,
@@ -71,7 +70,7 @@ def run_on_interactive_mode(source):
7170
return output
7271

7372

74-
@force_not_colorized_test_class
73+
@support.force_not_colorized_test_class
7574
class TestInteractiveInterpreter(unittest.TestCase):
7675

7776
@cpython_only
@@ -276,7 +275,7 @@ def test_asyncio_repl_is_ok(self):
276275
self.assertEqual(exit_code, 0, "".join(output))
277276

278277

279-
@force_not_colorized_test_class
278+
@support.force_not_colorized_test_class
280279
class TestInteractiveModeSyntaxErrors(unittest.TestCase):
281280

282281
def test_interactive_syntax_error_correct_line(self):

Lib/test/test_unittest/test_runner.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
import io
22
import os
3+
import sys
34
import pickle
45
import subprocess
5-
import sys
6-
import unittest
76
from test import support
8-
from test.support import force_not_colorized, force_not_colorized_test_class
7+
8+
import unittest
9+
from unittest.case import _Outcome
10+
911
from test.test_unittest.support import (
1012
BufferedWriter,
1113
LoggingResult,
1214
ResultWithNoStartTestRunStopTestRun,
1315
)
14-
from unittest.case import _Outcome
1516

1617

1718
def resultFactory(*_):
@@ -105,7 +106,7 @@ def cleanup2(*args, **kwargs):
105106
self.assertTrue(test.doCleanups())
106107
self.assertEqual(cleanups, [(2, (), {}), (1, (1, 2, 3), dict(four='hello', five='goodbye'))])
107108

108-
@force_not_colorized
109+
@support.force_not_colorized
109110
def testCleanUpWithErrors(self):
110111
class TestableTest(unittest.TestCase):
111112
def testNothing(self):
@@ -249,7 +250,7 @@ def testNothing(self):
249250
self.assertEqual(test._cleanups, [])
250251

251252

252-
@force_not_colorized_test_class
253+
@support.force_not_colorized_test_class
253254
class TestClassCleanup(unittest.TestCase):
254255
def test_addClassCleanUp(self):
255256
class TestableTest(unittest.TestCase):
@@ -602,7 +603,7 @@ class EmptyTest(unittest.TestCase):
602603
self.assertIn("\nNO TESTS RAN\n", runner.stream.getvalue())
603604

604605

605-
@force_not_colorized_test_class
606+
@support.force_not_colorized_test_class
606607
class TestModuleCleanUp(unittest.TestCase):
607608
def test_add_and_do_ModuleCleanup(self):
608609
module_cleanups = []
@@ -1320,7 +1321,7 @@ def MockResultClass(*args):
13201321
expectedresult = (runner.stream, DESCRIPTIONS, VERBOSITY)
13211322
self.assertEqual(runner._makeResult(), expectedresult)
13221323

1323-
@force_not_colorized
1324+
@support.force_not_colorized
13241325
@support.requires_subprocess()
13251326
def test_warnings(self):
13261327
"""

0 commit comments

Comments
 (0)