Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34k
gh-127873: Only check sys.flags.ignore_environment for PYTHON* env vars#127877
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Conversation
hugovk commented Dec 12, 2024 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
bedevere-bot commented Dec 13, 2024
This comment was marked as resolved.
This comment was marked as resolved.
hugovk commented Dec 17, 2024
@pablogsal Please could you have a look at this? Thanks! |
serhiy-storchaka commented Jan 20, 2025
Why do we use names without the |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
hugovk commented Jan 20, 2025
Yes, see https://force-color.org/ and https://no-color.org. |
hugovk commented Jan 21, 2025
Updated to use |
serhiy-storchaka left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Although you can use support.force_not_colorized_test_class in few more files.
hugovk commented Jan 21, 2025
Thank you for the reviews! |
05d12ee into python:mainUh oh!
There was an error while loading. Please reload this page.
Thanks @hugovk for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13. |
Sorry, @hugovk, I could not cleanly backport this to |
… `PYTHON*` env vars (pythonGH-127877) (cherry picked from commit 05d12ee) Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
GH-129138 is a backport of this pull request to the 3.13 branch. |
When
-Eis passed (and thereforesys.flags.ignore_environmentis true), we should only ignore only env vars matchingPYTHON*; in this case, onlyPYTHON_COLORS.We should not ignore the other env vars:
FORCE_COLOR/NO_COLOR/TERM.Re: https://docs.python.org/3/using/cmdline.html#cmdoption-E
Fixing this revealed some tests that failed because of inserted colour codes. For example, in "ZeroDivisionError: division by zero", the parts "ZeroDivisionError", ":" and "division by zero" are all different colours.
For these test cases, I wrapped them with the
@force_not_colorizeddecorator, or, where there were a number of them, I wrapped the test class in the newforce_not_colorized_test_classdecorator. This was a suggestion from #127223 (comment). And from that PR, I replaced some of the numerous function decorators with the class decorator.can_colorize()ignoresFORCE_COLOR/NO_COLOR/TERMwhen-Eis set #127873