Collecting Coverage Reports
$ pip install coverage
Assuming you already have the pytest installed, and can successfully run it (we covered it here)
you should be able to run:
$ coverage run -m pytest ============================= test session starts ============================== platform darwin -- Python 3.7.6, pytest-5.3.5, py-1.8.1, pluggy-0.13.1 rootdir: /Users/gulanurmatova/Desktop/python/coverage_reports plugins: hypothesis-5.5.4, arraydiff-0.3, remotedata-0.3.2, openfiles-0.4.0, doctestplus-0.5.0, astropy-header-0.1.2 collected 1 item test_math_functions.py . [100%] ============================== 1 passed in 0.03s ===============================
And then:
$ coverage report -m Name Stmts Miss Cover Missing ------------------------------------------------------ math_functions.py 8 0 100% test_math_functions.py 6 0 100% ------------------------------------------------------ TOTAL 14 0 100%
Here are the files I used:
coverage_reports.zip |