mirror of
https://github.com/python/cpython.git
synced 2025-07-23 19:25:40 +00:00
[3.13] gh-127873: Only check sys.flags.ignore_environment
for PYTHON*
env vars (GH-127877) (#129138)
This commit is contained in:
parent
f7f8b8b758
commit
cc3dc8ab24
22 changed files with 91 additions and 28 deletions
4
.github/CODEOWNERS
vendored
4
.github/CODEOWNERS
vendored
|
@ -267,3 +267,7 @@ Lib/test/test_interpreters/ @ericsnowcurrently
|
||||||
# Config Parser
|
# Config Parser
|
||||||
Lib/configparser.py @jaraco
|
Lib/configparser.py @jaraco
|
||||||
Lib/test/test_configparser.py @jaraco
|
Lib/test/test_configparser.py @jaraco
|
||||||
|
|
||||||
|
# Colorize
|
||||||
|
Lib/_colorize.py @hugovk
|
||||||
|
Lib/test/test__colorize.py @hugovk
|
||||||
|
|
|
@ -44,7 +44,6 @@ def can_colorize(*, file=None) -> bool:
|
||||||
return False
|
return False
|
||||||
if not COLORIZE:
|
if not COLORIZE:
|
||||||
return False
|
return False
|
||||||
if not sys.flags.ignore_environment:
|
|
||||||
if "FORCE_COLOR" in os.environ:
|
if "FORCE_COLOR" in os.environ:
|
||||||
return True
|
return True
|
||||||
if os.environ.get("TERM") == "dumb":
|
if os.environ.get("TERM") == "dumb":
|
||||||
|
|
|
@ -61,6 +61,7 @@ __all__ = [
|
||||||
"without_optimizer",
|
"without_optimizer",
|
||||||
"force_not_colorized",
|
"force_not_colorized",
|
||||||
"force_not_colorized_test_class",
|
"force_not_colorized_test_class",
|
||||||
|
"make_clean_env",
|
||||||
"BrokenIter",
|
"BrokenIter",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -2732,6 +2733,16 @@ def force_not_colorized_test_class(cls):
|
||||||
return cls
|
return cls
|
||||||
|
|
||||||
|
|
||||||
|
def make_clean_env() -> dict[str, str]:
|
||||||
|
clean_env = os.environ.copy()
|
||||||
|
for k in clean_env.copy():
|
||||||
|
if k.startswith("PYTHON"):
|
||||||
|
clean_env.pop(k)
|
||||||
|
clean_env.pop("FORCE_COLOR", None)
|
||||||
|
clean_env.pop("NO_COLOR", None)
|
||||||
|
return clean_env
|
||||||
|
|
||||||
|
|
||||||
def initialized_with_pyrepl():
|
def initialized_with_pyrepl():
|
||||||
"""Detect whether PyREPL was used during Python initialization."""
|
"""Detect whether PyREPL was used during Python initialization."""
|
||||||
# If the main module has a __file__ attribute it's a Python module, which means PyREPL.
|
# If the main module has a __file__ attribute it's a Python module, which means PyREPL.
|
||||||
|
|
|
@ -3,7 +3,7 @@ import sys
|
||||||
import unittest
|
import unittest
|
||||||
import unittest.mock
|
import unittest.mock
|
||||||
import _colorize
|
import _colorize
|
||||||
from test.support import force_not_colorized
|
from test.support import force_not_colorized, make_clean_env
|
||||||
|
|
||||||
ORIGINAL_CAN_COLORIZE = _colorize.can_colorize
|
ORIGINAL_CAN_COLORIZE = _colorize.can_colorize
|
||||||
|
|
||||||
|
@ -17,6 +17,14 @@ def tearDownModule():
|
||||||
|
|
||||||
|
|
||||||
class TestColorizeFunction(unittest.TestCase):
|
class TestColorizeFunction(unittest.TestCase):
|
||||||
|
def setUp(self):
|
||||||
|
# Remove PYTHON* environment variables to isolate from local user
|
||||||
|
# settings and simulate running with `-E`. Such variables should be
|
||||||
|
# added to test methods later to patched os.environ.
|
||||||
|
patcher = unittest.mock.patch("os.environ", new=make_clean_env())
|
||||||
|
self.addCleanup(patcher.stop)
|
||||||
|
patcher.start()
|
||||||
|
|
||||||
@force_not_colorized
|
@force_not_colorized
|
||||||
def test_colorized_detection_checks_for_environment_variables(self):
|
def test_colorized_detection_checks_for_environment_variables(self):
|
||||||
flags = unittest.mock.MagicMock(ignore_environment=False)
|
flags = unittest.mock.MagicMock(ignore_environment=False)
|
||||||
|
|
|
@ -75,6 +75,8 @@ class InstanceMethod:
|
||||||
id = _testcapi.instancemethod(id)
|
id = _testcapi.instancemethod(id)
|
||||||
testfunction = _testcapi.instancemethod(testfunction)
|
testfunction = _testcapi.instancemethod(testfunction)
|
||||||
|
|
||||||
|
|
||||||
|
@support.force_not_colorized_test_class
|
||||||
class CAPITest(unittest.TestCase):
|
class CAPITest(unittest.TestCase):
|
||||||
|
|
||||||
def test_instancemethod(self):
|
def test_instancemethod(self):
|
||||||
|
|
|
@ -88,6 +88,8 @@ def _make_test_zip_pkg(zip_dir, zip_basename, pkg_name, script_basename,
|
||||||
importlib.invalidate_caches()
|
importlib.invalidate_caches()
|
||||||
return to_return
|
return to_return
|
||||||
|
|
||||||
|
|
||||||
|
@support.force_not_colorized_test_class
|
||||||
class CmdLineTest(unittest.TestCase):
|
class CmdLineTest(unittest.TestCase):
|
||||||
def _check_output(self, script_name, exit_code, data,
|
def _check_output(self, script_name, exit_code, data,
|
||||||
expected_file, expected_argv0,
|
expected_file, expected_argv0,
|
||||||
|
|
|
@ -766,6 +766,7 @@ class CommandLineTestsBase:
|
||||||
rc, out, err = self.assertRunNotOK('-q', '-d', 'dinsdale', self.pkgdir)
|
rc, out, err = self.assertRunNotOK('-q', '-d', 'dinsdale', self.pkgdir)
|
||||||
self.assertRegex(out, b'File "dinsdale')
|
self.assertRegex(out, b'File "dinsdale')
|
||||||
|
|
||||||
|
@support.force_not_colorized
|
||||||
def test_d_runtime_error(self):
|
def test_d_runtime_error(self):
|
||||||
bazfn = script_helper.make_script(self.pkgdir, 'baz', 'raise Exception')
|
bazfn = script_helper.make_script(self.pkgdir, 'baz', 'raise Exception')
|
||||||
self.assertRunOK('-q', '-d', 'dinsdale', self.pkgdir)
|
self.assertRunOK('-q', '-d', 'dinsdale', self.pkgdir)
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
from codecs import BOM_UTF8
|
from codecs import BOM_UTF8
|
||||||
from test import support
|
from test.support import force_not_colorized
|
||||||
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.support import warnings_helper
|
from test.support import warnings_helper
|
||||||
|
@ -44,6 +44,7 @@ class EOFTestCase(unittest.TestCase):
|
||||||
self.assertEqual(cm.exception.text, "ä = '''thîs is ")
|
self.assertEqual(cm.exception.text, "ä = '''thîs is ")
|
||||||
self.assertEqual(cm.exception.offset, 5)
|
self.assertEqual(cm.exception.offset, 5)
|
||||||
|
|
||||||
|
@force_not_colorized
|
||||||
def test_EOFS_with_file(self):
|
def test_EOFS_with_file(self):
|
||||||
expect = ("(<string>, line 1)")
|
expect = ("(<string>, line 1)")
|
||||||
with os_helper.temp_dir() as temp_dir:
|
with os_helper.temp_dir() as temp_dir:
|
||||||
|
@ -123,6 +124,7 @@ class EOFTestCase(unittest.TestCase):
|
||||||
self.assertEqual(str(cm.exception), expect)
|
self.assertEqual(str(cm.exception), expect)
|
||||||
|
|
||||||
@unittest.skipIf(not sys.executable, "sys.executable required")
|
@unittest.skipIf(not sys.executable, "sys.executable required")
|
||||||
|
@force_not_colorized
|
||||||
def test_line_continuation_EOF_from_file_bpo2180(self):
|
def test_line_continuation_EOF_from_file_bpo2180(self):
|
||||||
"""Ensure tok_nextc() does not add too many ending newlines."""
|
"""Ensure tok_nextc() does not add too many ending newlines."""
|
||||||
with os_helper.temp_dir() as temp_dir:
|
with os_helper.temp_dir() as temp_dir:
|
||||||
|
|
|
@ -1465,6 +1465,7 @@ class ExceptionTests(unittest.TestCase):
|
||||||
|
|
||||||
@cpython_only
|
@cpython_only
|
||||||
@unittest.skipIf(_testcapi is None, "requires _testcapi")
|
@unittest.skipIf(_testcapi is None, "requires _testcapi")
|
||||||
|
@force_not_colorized
|
||||||
def test_recursion_normalizing_infinite_exception(self):
|
def test_recursion_normalizing_infinite_exception(self):
|
||||||
# Issue #30697. Test that a RecursionError is raised when
|
# Issue #30697. Test that a RecursionError is raised when
|
||||||
# maximum recursion depth has been exceeded when creating
|
# maximum recursion depth has been exceeded when creating
|
||||||
|
@ -2157,6 +2158,7 @@ class AssertionErrorTests(unittest.TestCase):
|
||||||
self.assertEqual(result[-len(expected):], expected)
|
self.assertEqual(result[-len(expected):], expected)
|
||||||
|
|
||||||
|
|
||||||
|
@support.force_not_colorized_test_class
|
||||||
class SyntaxErrorTests(unittest.TestCase):
|
class SyntaxErrorTests(unittest.TestCase):
|
||||||
maxDiff = None
|
maxDiff = None
|
||||||
|
|
||||||
|
|
|
@ -29,9 +29,20 @@ import _imp
|
||||||
|
|
||||||
from test.support import os_helper
|
from test.support import os_helper
|
||||||
from test.support import (
|
from test.support import (
|
||||||
STDLIB_DIR, swap_attr, swap_item, cpython_only, is_apple_mobile, is_emscripten,
|
STDLIB_DIR,
|
||||||
is_wasi, run_in_subinterp, run_in_subinterp_with_config, Py_TRACE_REFS,
|
swap_attr,
|
||||||
requires_gil_enabled, Py_GIL_DISABLED)
|
swap_item,
|
||||||
|
cpython_only,
|
||||||
|
is_apple_mobile,
|
||||||
|
is_emscripten,
|
||||||
|
is_wasi,
|
||||||
|
run_in_subinterp,
|
||||||
|
run_in_subinterp_with_config,
|
||||||
|
Py_TRACE_REFS,
|
||||||
|
requires_gil_enabled,
|
||||||
|
Py_GIL_DISABLED,
|
||||||
|
force_not_colorized_test_class,
|
||||||
|
)
|
||||||
from test.support.import_helper import (
|
from test.support.import_helper import (
|
||||||
forget, make_legacy_pyc, unlink, unload, ready_to_import,
|
forget, make_legacy_pyc, unlink, unload, ready_to_import,
|
||||||
DirsOnSysPath, CleanImport, import_module)
|
DirsOnSysPath, CleanImport, import_module)
|
||||||
|
@ -352,6 +363,7 @@ class ModuleSnapshot(types.SimpleNamespace):
|
||||||
return cls.parse(text.decode())
|
return cls.parse(text.decode())
|
||||||
|
|
||||||
|
|
||||||
|
@force_not_colorized_test_class
|
||||||
class ImportTests(unittest.TestCase):
|
class ImportTests(unittest.TestCase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
|
|
|
@ -880,6 +880,7 @@ class TestGetsourceStdlib(unittest.TestCase):
|
||||||
self.assertEqual(src.splitlines(True), lines)
|
self.assertEqual(src.splitlines(True), lines)
|
||||||
|
|
||||||
class TestGetsourceInteractive(unittest.TestCase):
|
class TestGetsourceInteractive(unittest.TestCase):
|
||||||
|
@support.force_not_colorized
|
||||||
def test_getclasses_interactive(self):
|
def test_getclasses_interactive(self):
|
||||||
# bpo-44648: simulate a REPL session;
|
# bpo-44648: simulate a REPL session;
|
||||||
# there is no `__file__` in the __main__ module
|
# there is no `__file__` in the __main__ module
|
||||||
|
|
|
@ -101,16 +101,6 @@ handle_events_narrow_console = partial(
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def make_clean_env() -> dict[str, str]:
|
|
||||||
clean_env = os.environ.copy()
|
|
||||||
for k in clean_env.copy():
|
|
||||||
if k.startswith("PYTHON"):
|
|
||||||
clean_env.pop(k)
|
|
||||||
clean_env.pop("FORCE_COLOR", None)
|
|
||||||
clean_env.pop("NO_COLOR", None)
|
|
||||||
return clean_env
|
|
||||||
|
|
||||||
|
|
||||||
class FakeConsole(Console):
|
class FakeConsole(Console):
|
||||||
def __init__(self, events, encoding="utf-8") -> None:
|
def __init__(self, events, encoding="utf-8") -> None:
|
||||||
self.events = iter(events)
|
self.events = iter(events)
|
||||||
|
|
|
@ -10,7 +10,7 @@ import sys
|
||||||
import tempfile
|
import tempfile
|
||||||
from unittest import TestCase, skipUnless, skipIf
|
from unittest import TestCase, skipUnless, skipIf
|
||||||
from unittest.mock import patch
|
from unittest.mock import patch
|
||||||
from test.support import force_not_colorized
|
from test.support import force_not_colorized, make_clean_env
|
||||||
from test.support import SHORT_TIMEOUT
|
from test.support import SHORT_TIMEOUT
|
||||||
from test.support.import_helper import import_module
|
from test.support.import_helper import import_module
|
||||||
from test.support.os_helper import unlink
|
from test.support.os_helper import unlink
|
||||||
|
@ -23,7 +23,6 @@ from .support import (
|
||||||
multiline_input,
|
multiline_input,
|
||||||
code_to_events,
|
code_to_events,
|
||||||
clean_screen,
|
clean_screen,
|
||||||
make_clean_env,
|
|
||||||
)
|
)
|
||||||
from _pyrepl.console import Event
|
from _pyrepl.console import Event
|
||||||
from _pyrepl.readline import (ReadlineAlikeReader, ReadlineConfig,
|
from _pyrepl.readline import (ReadlineAlikeReader, ReadlineConfig,
|
||||||
|
|
|
@ -789,6 +789,7 @@ class CheckActualTests(BaseTestCase):
|
||||||
f'{", ".join(output.splitlines())}')
|
f'{", ".join(output.splitlines())}')
|
||||||
|
|
||||||
|
|
||||||
|
@support.force_not_colorized_test_class
|
||||||
class ProgramsTestCase(BaseTestCase):
|
class ProgramsTestCase(BaseTestCase):
|
||||||
"""
|
"""
|
||||||
Test various ways to run the Python test suite. Use options close
|
Test various ways to run the Python test suite. Use options close
|
||||||
|
@ -902,6 +903,7 @@ class ProgramsTestCase(BaseTestCase):
|
||||||
self.run_batch(script, *rt_args, *self.regrtest_args, *self.tests)
|
self.run_batch(script, *rt_args, *self.regrtest_args, *self.tests)
|
||||||
|
|
||||||
|
|
||||||
|
@support.force_not_colorized_test_class
|
||||||
class ArgsTestCase(BaseTestCase):
|
class ArgsTestCase(BaseTestCase):
|
||||||
"""
|
"""
|
||||||
Test arguments of the Python test suite.
|
Test arguments of the Python test suite.
|
||||||
|
|
|
@ -70,6 +70,7 @@ def run_on_interactive_mode(source):
|
||||||
return output
|
return output
|
||||||
|
|
||||||
|
|
||||||
|
@support.force_not_colorized_test_class
|
||||||
class TestInteractiveInterpreter(unittest.TestCase):
|
class TestInteractiveInterpreter(unittest.TestCase):
|
||||||
|
|
||||||
@cpython_only
|
@cpython_only
|
||||||
|
@ -273,6 +274,8 @@ class TestInteractiveInterpreter(unittest.TestCase):
|
||||||
|
|
||||||
self.assertEqual(exit_code, 0, "".join(output))
|
self.assertEqual(exit_code, 0, "".join(output))
|
||||||
|
|
||||||
|
|
||||||
|
@support.force_not_colorized_test_class
|
||||||
class TestInteractiveModeSyntaxErrors(unittest.TestCase):
|
class TestInteractiveModeSyntaxErrors(unittest.TestCase):
|
||||||
|
|
||||||
def test_interactive_syntax_error_correct_line(self):
|
def test_interactive_syntax_error_correct_line(self):
|
||||||
|
|
|
@ -12,8 +12,14 @@ import tempfile
|
||||||
import textwrap
|
import textwrap
|
||||||
import unittest
|
import unittest
|
||||||
import warnings
|
import warnings
|
||||||
from test.support import (infinite_recursion, no_tracing, verbose,
|
from test.support import (
|
||||||
requires_subprocess, requires_resource)
|
force_not_colorized_test_class,
|
||||||
|
infinite_recursion,
|
||||||
|
no_tracing,
|
||||||
|
requires_resource,
|
||||||
|
requires_subprocess,
|
||||||
|
verbose,
|
||||||
|
)
|
||||||
from test.support.import_helper import forget, make_legacy_pyc, unload
|
from test.support.import_helper import forget, make_legacy_pyc, unload
|
||||||
from test.support.os_helper import create_empty_file, temp_dir, FakePath
|
from test.support.os_helper import create_empty_file, temp_dir, FakePath
|
||||||
from test.support.script_helper import make_script, make_zip_script
|
from test.support.script_helper import make_script, make_zip_script
|
||||||
|
@ -758,6 +764,7 @@ s = "non-ASCII: h\xe9"
|
||||||
self.assertEqual(result['s'], "non-ASCII: h\xe9")
|
self.assertEqual(result['s'], "non-ASCII: h\xe9")
|
||||||
|
|
||||||
|
|
||||||
|
@force_not_colorized_test_class
|
||||||
class TestExit(unittest.TestCase):
|
class TestExit(unittest.TestCase):
|
||||||
STATUS_CONTROL_C_EXIT = 0xC000013A
|
STATUS_CONTROL_C_EXIT = 0xC000013A
|
||||||
EXPECTED_CODE = (
|
EXPECTED_CODE = (
|
||||||
|
|
|
@ -981,6 +981,7 @@ class TestCommandLine(unittest.TestCase):
|
||||||
return
|
return
|
||||||
self.fail(f"unexpected output: {stderr!a}")
|
self.fail(f"unexpected output: {stderr!a}")
|
||||||
|
|
||||||
|
@force_not_colorized
|
||||||
def test_sys_xoptions_invalid(self):
|
def test_sys_xoptions_invalid(self):
|
||||||
for nframe in INVALID_NFRAME:
|
for nframe in INVALID_NFRAME:
|
||||||
with self.subTest(nframe=nframe):
|
with self.subTest(nframe=nframe):
|
||||||
|
|
|
@ -11,8 +11,14 @@ from http.client import HTTPException
|
||||||
import sys
|
import sys
|
||||||
import unicodedata
|
import unicodedata
|
||||||
import unittest
|
import unittest
|
||||||
from test.support import (open_urlresource, requires_resource, script_helper,
|
from test.support import (
|
||||||
cpython_only, check_disallow_instantiation)
|
open_urlresource,
|
||||||
|
requires_resource,
|
||||||
|
script_helper,
|
||||||
|
cpython_only,
|
||||||
|
check_disallow_instantiation,
|
||||||
|
force_not_colorized,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class UnicodeMethodsTest(unittest.TestCase):
|
class UnicodeMethodsTest(unittest.TestCase):
|
||||||
|
@ -277,6 +283,7 @@ class UnicodeMiscTest(UnicodeDatabaseTest):
|
||||||
# Ensure that the type disallows instantiation (bpo-43916)
|
# Ensure that the type disallows instantiation (bpo-43916)
|
||||||
check_disallow_instantiation(self, unicodedata.UCD)
|
check_disallow_instantiation(self, unicodedata.UCD)
|
||||||
|
|
||||||
|
@force_not_colorized
|
||||||
def test_failed_import_during_compiling(self):
|
def test_failed_import_during_compiling(self):
|
||||||
# Issue 4367
|
# Issue 4367
|
||||||
# Decoding \N escapes requires the unicodedata module. If it can't be
|
# Decoding \N escapes requires the unicodedata module. If it can't be
|
||||||
|
|
|
@ -7,6 +7,7 @@ import test.test_unittest
|
||||||
from test.test_unittest.test_result import BufferedWriter
|
from test.test_unittest.test_result import BufferedWriter
|
||||||
|
|
||||||
|
|
||||||
|
@support.force_not_colorized_test_class
|
||||||
class Test_TestProgram(unittest.TestCase):
|
class Test_TestProgram(unittest.TestCase):
|
||||||
|
|
||||||
def test_discovery_from_dotted_path(self):
|
def test_discovery_from_dotted_path(self):
|
||||||
|
|
|
@ -33,6 +33,7 @@ def bad_cleanup2():
|
||||||
raise ValueError('bad cleanup2')
|
raise ValueError('bad cleanup2')
|
||||||
|
|
||||||
|
|
||||||
|
@force_not_colorized_test_class
|
||||||
class Test_TestResult(unittest.TestCase):
|
class Test_TestResult(unittest.TestCase):
|
||||||
# Note: there are not separate tests for TestResult.wasSuccessful(),
|
# Note: there are not separate tests for TestResult.wasSuccessful(),
|
||||||
# TestResult.errors, TestResult.failures, TestResult.testsRun or
|
# TestResult.errors, TestResult.failures, TestResult.testsRun or
|
||||||
|
@ -456,6 +457,7 @@ class Test_TestResult(unittest.TestCase):
|
||||||
self.assertTrue(stream.getvalue().endswith('\n\nOK\n'))
|
self.assertTrue(stream.getvalue().endswith('\n\nOK\n'))
|
||||||
|
|
||||||
|
|
||||||
|
@force_not_colorized_test_class
|
||||||
class Test_TextTestResult(unittest.TestCase):
|
class Test_TextTestResult(unittest.TestCase):
|
||||||
maxDiff = None
|
maxDiff = None
|
||||||
|
|
||||||
|
|
|
@ -106,6 +106,7 @@ class TestCleanUp(unittest.TestCase):
|
||||||
self.assertTrue(test.doCleanups())
|
self.assertTrue(test.doCleanups())
|
||||||
self.assertEqual(cleanups, [(2, (), {}), (1, (1, 2, 3), dict(four='hello', five='goodbye'))])
|
self.assertEqual(cleanups, [(2, (), {}), (1, (1, 2, 3), dict(four='hello', five='goodbye'))])
|
||||||
|
|
||||||
|
@support.force_not_colorized
|
||||||
def testCleanUpWithErrors(self):
|
def testCleanUpWithErrors(self):
|
||||||
class TestableTest(unittest.TestCase):
|
class TestableTest(unittest.TestCase):
|
||||||
def testNothing(self):
|
def testNothing(self):
|
||||||
|
@ -249,6 +250,7 @@ class TestCleanUp(unittest.TestCase):
|
||||||
self.assertEqual(test._cleanups, [])
|
self.assertEqual(test._cleanups, [])
|
||||||
|
|
||||||
|
|
||||||
|
@support.force_not_colorized_test_class
|
||||||
class TestClassCleanup(unittest.TestCase):
|
class TestClassCleanup(unittest.TestCase):
|
||||||
def test_addClassCleanUp(self):
|
def test_addClassCleanUp(self):
|
||||||
class TestableTest(unittest.TestCase):
|
class TestableTest(unittest.TestCase):
|
||||||
|
@ -601,6 +603,7 @@ class TestClassCleanup(unittest.TestCase):
|
||||||
self.assertIn("\nNO TESTS RAN\n", runner.stream.getvalue())
|
self.assertIn("\nNO TESTS RAN\n", runner.stream.getvalue())
|
||||||
|
|
||||||
|
|
||||||
|
@support.force_not_colorized_test_class
|
||||||
class TestModuleCleanUp(unittest.TestCase):
|
class TestModuleCleanUp(unittest.TestCase):
|
||||||
def test_add_and_do_ModuleCleanup(self):
|
def test_add_and_do_ModuleCleanup(self):
|
||||||
module_cleanups = []
|
module_cleanups = []
|
||||||
|
@ -1318,6 +1321,7 @@ class Test_TextTestRunner(unittest.TestCase):
|
||||||
expectedresult = (runner.stream, DESCRIPTIONS, VERBOSITY)
|
expectedresult = (runner.stream, DESCRIPTIONS, VERBOSITY)
|
||||||
self.assertEqual(runner._makeResult(), expectedresult)
|
self.assertEqual(runner._makeResult(), expectedresult)
|
||||||
|
|
||||||
|
@support.force_not_colorized
|
||||||
@support.requires_subprocess()
|
@support.requires_subprocess()
|
||||||
def test_warnings(self):
|
def test_warnings(self):
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
When ``-E`` is set, only ignore ``PYTHON_COLORS`` and not
|
||||||
|
``FORCE_COLOR``/``NO_COLOR``/``TERM`` when colourising output.
|
||||||
|
Patch by Hugo van Kemenade.
|
Loading…
Add table
Add a link
Reference in a new issue