August 2018
Beginner
160 pages
4h 8m
English
We learned some very useful command-line options. Some of them might become personal favorites, but having to type them all the time would be annoying.
The addopts configuration option can be used instead to always add a set of options to the command line:
[pytest]addopts=--tb=native --maxfail=10 -v
With that configuration, typing the following:
λ pytest tests/test_core.py
Is the same as typing:
λ pytest --tb=native --max-fail=10 -v tests/test_core.py
Note that, despite its name, addopts actually inserts the options before other options typed in the command line. This makes it possible to override most options in addopts when passing them in explicitly.
For example, the following code will now display auto ...
Read now
Unlock full access