pytest
pytest copied to clipboard
Resolving Issue #11666 - Using Richer Color Terminal Formatters
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 and TerminalTrueColorFormatter alongside the previously used TerminalFormatter. 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 variable PYTEST_THEME). The contributor attempted this but had errors due to PYTEST_THEME returning 'None'.
Changes
Terminal256Formatter, TerminalTrueColorFormatter and TerminalFormatter are used depending on environment variables.
Style of Terminal256Formatter and TerminalTrueColorFormatter is determined by the PYTEST_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