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.
Running pytest -vv should make your output more verbose. If you want your output to be less verbose, try pytest -q or pytest --quiet .
Calling pytest through python -m pytest You can invoke testing through the Python interpreter from the command line: python -m pytest [...] This is almost equivalent to invoking the command line script pytest [...] directly, except that calling via python will also add the current directory to sys.
Verbosity. The -v flag controls the verbosity of pytest output in various aspects: test session progress, assertion details when tests fail, fixtures details with --fixtures , etc.
Additionally, if you wish to display a list of fixtures for each test, try the --fixtures-per-test flag.
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"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With