Skip to content

gh-130293: Ensure test__colorize will pass on dumb terminals.#130333

Merged
freakboy3742 merged 2 commits intopython:mainfrom
freakboy3742:ios-colorize
Feb 20, 2025
Merged

gh-130293: Ensure test__colorize will pass on dumb terminals.#130333
freakboy3742 merged 2 commits intopython:mainfrom
freakboy3742:ios-colorize

Conversation

@freakboy3742
Copy link
Contributor

@freakboy3742 freakboy3742 commented Feb 20, 2025

#129140 slightly modified the logic associated with determining if a console could be colorised. In doing so, the test became sensitive to the test environment's value for the TERM setting.

The iOS 18.2 test simulator sets TERM=dumb in the test environment - this makes some sense, as stdout/stderr handling is performed by the system log, which won't honor tty control sequences.

This appears to be a recent change to iOS; it wasn't true in iOS 17.2. With the recent update to the iOS buildbot, the problem became apparent.

However, the issue isn't iOS specific - it will occur on any machine where TERM=dumb is set in the testing environment. On macOS, I can reproduce the issue with:

TERM=dumb python3.14 -m test test__colorize

This PR ensures that TERM is correctly mocked as part of the colorise test, and normalizes the name used by the iOS Testbed to disable terminal colors.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants