Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Start a free Courses trial
to watch this video
`coverage.py` is an amazing library for determining how much of your code is covered by your tests and how much still needs to be tested. Let's look at how to install it, run it, and get handy reports from it.
Installing coverage.py
pip install coverage
Using coverage.py
Make sure you test file can be run from the command line without the -m unittest
argument.
coverage run tests.py
Generate a report
coverage report
or coverage report -m
if you want the missed lines.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up