August 2018
Beginner
160 pages
4h 8m
English
The pytest-cov plugin provides integration with the popular coverage module, which provides detailed coverage reports for your code when running tests. This lets you detect sections of code that are not covered by any test code, which is an opportunity to write more tests to cover those cases.
After installation, you can use the --cov option to provide a coverage report at the end of the test run:
λ pytest --cov=src...----------- coverage: platform win32, python 3.6.3-final-0 -----------Name Stmts Miss Cover----------------------------------------src/series.py 108 5 96%src/tests/test_series 22 0 100%----------------------------------------TOTAL 130 5 97%
The --cov option accepts a path to source files that should have reports generated, ...
Read now
Unlock full access