Skip to content

Commit 1b07006

Browse files
authored
gh-130293: Ensure test__colorize will pass on dumb terminals. (#130333)
Ensure colorize tests will run on dumb terminals (or environment with TERM=dumb set) Co-authored-by: Hugo van Kemenade <[email protected]>
1 parent ee337be commit 1b07006

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

Lib/test/test__colorize.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
@contextlib.contextmanager
1111
def clear_env():
1212
with EnvironmentVarGuard() as mock_env:
13-
for var in "FORCE_COLOR", "NO_COLOR", "PYTHON_COLORS":
13+
for var in "FORCE_COLOR", "NO_COLOR", "PYTHON_COLORS", "TERM":
1414
mock_env.unset(var)
1515
yield mock_env
1616

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
The tests of terminal colorization are no longer sensitive to the value of
2+
the ``TERM`` variable in the testing environment.

iOS/testbed/iOSTestbedTests/iOSTestbedTests.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ - (void)testPython {
2828
// Xcode log can't display color. Stdout will report that it is *not* a
2929
// TTY.
3030
setenv("NO_COLOR", "1", true);
31-
setenv("PY_COLORS", "0", true);
31+
setenv("PYTHON_COLORS", "0", true);
3232

3333
// Arguments to pass into the test suite runner.
3434
// argv[0] must identify the process; any subsequent arg

0 commit comments

Comments
 (0)