0

I would like to print coverage report for my unit tests written with Python Standard Library's unittest in the same fashion as I am able to print coverage report for unit test files written with pytest using commands pytest --cov libraries.foo libraries\tests\test_library_foo.py and then coverage report -m with the output:

Name                                    Stmts   Miss  Cover   Missing
------------------------------------------------------------------------------
libraries\tests\test_library_foo.py     200     10    95%     50-65, 70-85
------------------------------------------------------------------------------
TOTAL                                   200     10    95%

1 Answer 1

2

From the coverage documentation:

$ coverage run -m unittest libraries.foo libraries\tests\test_library_foo.py
$ coverage report -m
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.