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. It can show which parts of your code are being exercised by tests, and which are not. Use coverage run to run your test suite and gather data. However you normally run your test suite, and you can run your test runner under coverage. If your test runner command starts with “python”, just replace the initial “python” with “coverage run”. To limit coverage measurement to code in the current directory, and also find files that weren’t executed at all, add the source argument to your coverage command line. By default, it will measure line (statement) coverage. It can also measure branch coverage. It can tell you what tests ran which lines.