Resolving Issue #11666 - Using Richer Color Terminal Formatters #12317
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi,
This pull request attempts to resolve issue #11666 by implementing richer color terminal formatters from the pygments library.
Description
Many of the changes made were by referring to the previously closed pull request #11700 .The author of that pull request made several changes such as importing the
Terminal256Formatter
andTerminalTrueColorFormatter
alongside the previously usedTerminalFormatter
. User environment variables were taken to decide which formatter would be used. However, the author of the issue stated that user configuration of the style used by the formatters is preffered (by using the environment variablePYTEST_THEME
). The contributor attempted this but had errors due toPYTEST_THEME
returning 'None'.Changes
Terminal256Formatter
,TerminalTrueColorFormatter
andTerminalFormatter
are used depending on environment variables.Style of
Terminal256Formatter
andTerminalTrueColorFormatter
is determined by thePYTEST_THEME
environment variable.In the case
PYTEST_THEME
returns 'None', the default style is used instead.This is my first attempt at contributing to an open source project so any feedback or criticisms are welcome.
Thank you,
Pandula