-
Notifications
You must be signed in to change notification settings - Fork 37
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
fix: add support for no colors mode #359
Conversation
Codecov Report
@@ Coverage Diff @@
## master #359 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 19 19
Lines 957 992 +35
=========================================
+ Hits 957 992 +35 |
| `--snapshot-update` | Snapshots will be updated to match assertions and unused snapshots will be deleted. | `False` | | ||
| `--snapshot-warn-unused` | Prints a warning on unused snapshots rather than fail the test suite. | `False` | | ||
| `--snapshot-default-extension` | Use to change the default snapshot extension class. | `syrupy.extensions.amber.AmberSnapshotExtension` | | ||
| `--snapshot-no-colors` | Disable test results output highlighting. Equivalent to setting the environment variables `ANSI_COLORS_DISABLED` or `NO_COLOR` | Disabled by default if not in terminal. | |
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.
Does pytest also natively support ANSI_COLORS_DISABLED
?
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.
pytest supports by default
NO_COLOR
So added both
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
|
||
|
||
def _is_color_disabled() -> bool: | ||
return any(map(get_env_value, DISABLE_COLOR_ENV_VARS)) |
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.
I'm fine with this (and actually prefer it) but I thought we had a lint rule around preferring comprehension over map/reduce etc
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.
I don't think there's a lint rule around it, just a general case by case basis imo
## [0.7.2](v0.7.1...v0.7.2) (2020-09-20) ### Bug Fixes * add support for no colors mode ([#359](#359)) ([ec39b80](ec39b80))
🎉 This PR is included in version 0.7.2 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Description
Adds support no colors mode with environment variables
NO_COLOR
,ANSI_COLORS_DISABLED
or pytest option.Related Issues
Checklist
Additional Comments
NO_COLOR