Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll

- 2x 2x
- 1.75x 1.75x
- 1.5x 1.5x
- 1.25x 1.25x
- 1.1x 1.1x
- 1x 1x
- 0.75x 0.75x
- 0.5x 0.5x
`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 up-
Ollie Webster
5,035 Points1 Answer
-
ds1
7,627 Points2 Answers
-
iworld
4,125 Points2 Answers
-
PLUS
nguoisechiavn
Courses Plus Student 6,382 Points4 Answers
-
Gianmarco Mazzoran
22,076 Points1 Answer
-
Michaël Ménaché
5,261 Points11 Answers
-
Larissa Rose
27,681 Points1 Answer
View all discussions for this video
Related 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