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.
相关问题
- ImportError shows up with py.test, but not when ru
- Run trace.py with pytest
- What is a correct approach to manage test data usi
- Empty messages in caplog when logs emmited in a di
- Flask unit testing - How to reset app.url_map for
相关文章
- trying to make paths work - attempted relative imp
- Preventing truncation of long strings in pytest
- Pytest - error vs fail
- Disable Pytest in PyCharm
- maintaining order of test execution when parametri
- Scrapy raises ReactorNotRestartable when CrawlerPr
- Change pytest testsuite name in xml report
- How to get a list of TestReports at the end of a p
As of 2.5.0 py.test has the option
--color=yes
As of 2.7.0, it should be also possible to do:
The "py" library that pytest uses will not use color if it doesn't detect a terminal. I ended up making a change to it to allow setting an enviroment variable (
PY_FORCE_COLOR=1
) to force the color.I submitted a PR for this: https://bitbucket.org/hpk42/py/pull-request/10/add-an-environment-variable-py_force_color
For now, I install my fork to do this:
pip install hg+https://msabramo@bitbucket.org/msabramo/py@py_force_color