February 2022
Intermediate to advanced
274 pages
6h 28m
English
In this chapter, we used coverage.py and pytest-cov to measure code coverage and used quite a few commands and options.
For running coverage with pytest-cov, use:
pytest --cov=cards <test path> to run with a simple report
pytest --cov=cards --cov-report=term-missing <test path> to show which lines weren’t run
pytest --cov=cards --cov-report=html <test path> to generate an HTML report
For running coverage by itself, use:
Even if you ran coverage from pytest --cov=..., you can run different reports or generate ...
Read now
Unlock full access