pytest

How do I force pytest to write color output?


How do I force pytest to show the results in color, even when writing to a pipe? There does not seem to be any command line option to do so.


Solution

  • As of 2.5.0 py.test has the option --color=yes

    As of 2.7.0, it should be also possible to do:

    export PYTEST_ADDOPTS="--color=yes"