Skip to content
Search

Coverage.py

lastmod 2021-09-14created 2020-12-143 edits

Code coverage measurement for Python.

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.

Exclusions

How to exclude code within the code:

  • A line containing a # pragma: no cover comment.
  • Or a line containing a # nocov or # noqa comment.
  • See exclude_lines in the [report] section of the tox.ini file.

Troubleshooting

coverage.py malfunctions after exec

See Python:builtins#coverage.py malfunctions after exec.

See also

Favorite site

author Zer0 sitemap