Commands
When you install coverage.py, a command called coverage is installed for
command-line use. It has a number of commands:
combine – Combine together a number of data files.
report – Report coverage results.
html – Produce annotated HTML listings with coverage results.
annotate – Annotate source files with coverage results.
debug – Get diagnostic information.
Global options
Help is available with the help command, or with the --help switch on
any other command:
$ coverage help
$ coverage help run
$ coverage run --help
Version information for coverage.py can be displayed with
coverage --version:
$ coverage --version Coverage.py, version 7.13.5 with C extension Documentation at https://coverage.readthedocs.io/en/7.13.5
Any command can use a configuration file by specifying it with the
--rcfile=FILE command-line switch. Any option you can set on the command
line can also be set in the configuration file. This can be a better way to
control coverage.py since the configuration file can be checked into source
control, and can provide options that other invocation techniques (like test
runner plugins) may not offer. See Configuration reference for more details.
For diagnosing problems, commands accept a --debug option. See
--debug option.
Commands
The details of each command are on these pages:
- Execution:
coverage run - Combining data files:
coverage combine - Erase data:
coverage erase - Reporting
- Coverage summary:
coverage report - HTML reporting:
coverage html - XML reporting:
coverage xml - JSON reporting:
coverage json - LCOV reporting:
coverage lcov - Text annotation:
coverage annotate - Diagnostics:
coverage debug