How do I force pytest to write color output?

前端 未结 2 499
遥遥无期
遥遥无期 2021-02-02 07:31

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.

2条回答
  •  野的像风
    2021-02-02 08:24

    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"
    

提交回复
热议问题