Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
gh-130293: Ensure test__colorize will pass on dumb terminals. (GH-130333
)

Ensure colorize tests will run on dumb terminals (or environment with TERM=dumb set)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
(cherry picked from commit 1b07006)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
  • Loading branch information
freakboy3742 authored and miss-islington committed Feb 20, 2025
commit b36214bb3ab9bcc6bcf43885fe4566c35e2e5522
2 changes: 1 addition & 1 deletion Lib/test/test__colorize.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
@contextlib.contextmanager
def clear_env():
with EnvironmentVarGuard() as mock_env:
for var in "FORCE_COLOR", "NO_COLOR", "PYTHON_COLORS":
for var in "FORCE_COLOR", "NO_COLOR", "PYTHON_COLORS", "TERM":
mock_env.unset(var)
yield mock_env

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
The tests of terminal colorization are no longer sensitive to the value of
the ``TERM`` variable in the testing environment.
2 changes: 1 addition & 1 deletion iOS/testbed/iOSTestbedTests/iOSTestbedTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ - (void)testPython {
// Xcode log can't display color. Stdout will report that it is *not* a
// TTY.
setenv("NO_COLOR", "1", true);
setenv("PY_COLORS", "0", true);
setenv("PYTHON_COLORS", "0", true);

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