Last active
August 21, 2017 03:53
-
-
Save floer32/1aeb36ee85f4bdce0899 to your computer and use it in GitHub Desktop.
Run pytest with doctests and coverage from doctests AND normal unittests/pytests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A coworker of mine covinced himself that the built-in pytest doctest support module didn't integrate with pytest-cov. | |
# He wrote his shim to get around this. Not necessary though. | |
# The gist is to make sure you have "--doctest-modules" and "--cov-report" and "--cov" arguments. | |
py.test . --doctest-modules --cov-report term --cov=. | |
# or | |
py.test mymodule --doctest-modules --cov-report term --cov=mymodule |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A coworker of mine covinced himself that the built-in pytest doctest support module didn't integrate with pytest-cov.
He wrote a shim to get around this, but actually that's not necessary...
The gist is to make sure you have "--doctest-modules" and "--cov-report" and "--cov" arguments.