-
Notifications
You must be signed in to change notification settings - Fork 55
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
Support the NO_COLOR
environment variable
#356
Conversation
0bca0c4
to
ddc1c69
Compare
ddc1c69
to
c1d0f03
Compare
b26a069
to
18d5232
Compare
@roniemartinez & @MatthijsBurgh, in addition to adding support for the There are now four test functions:
To reduce duplication and boilerplate, I've created some parametrized fixtures instead of straight using I still suspect that for someone fresh looking at the tests, the resulting 256 lines of Python code are more difficult to understand and maintain than the 254 lines (here still just 146 lines since |
3433c4d
to
6f58379
Compare
Also uninstall Pygments and sanitize environment variables using fixtures.
37130ea
to
838d2c1
Compare
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
Setting
NO_COLOR
to any non-empty value will disable syntax highlighting even on terminal output. This overrides thecolor = true
setting inpyproject.toml
, but will be overridden byPY_COLORS=1
or the--color
command line option, if those are present.Fixes #355.
Previously, #353 added a command line options, a
pyproject.toml
option and thePY_COLORS
environment variable to for enabling/disabling syntax highlighting.See earlier discussion in #353, and pypa/pip#10909, for the reasoning behind supporting both
NO_COLOR
andPY_COLORS
.FORCE_COLOR
as well (see this comment in pypa/pip)FORCE_COLOR
NO_COLOR
andFORCE_COLOR
should be considered as activating that option, similar to how Pytest works