How can you get unittest2
and coverage.py
working together?
In theory something like
coverage run unit2 discover
should work, but it currently just errors out.
If you are a nose
user that will be the equivalent of nosetests --with-coverage
.
Coverage.py is a tool for measuring code coverage of Python programs. It monitors your program, noting which parts of the code have been executed, then analyzes the source to identify code that could have been executed but was not. Coverage measurement is typically used to gauge the effectiveness of tests.
Increase coverage by adding more tests The code coverage has increased to 78% on adding another test case. It can be increased further to 100% in a similar fashion.
Try:
coverage run -m unittest discover
works for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With