A coverage plugin to provide sensible default settings
Low maintenance activity. Last release over 3 years ago, commits in 6 of the last 26 weeks. Weaker on recent releases and release cadence.
pip install covdefaultscovdefaults
A coverage plugin to provide sensible default settings
installation
pip install covdefaults
usage
to enable the plugin, add covdefaults to your coverage plugins
in .coveragerc:
[run]
plugins = covdefaults
in setup.cfg / tox.ini:
[coverage:run]
plugins = covdefaults
in pyproject.toml:
[tool.coverage.run]
plugins = ["covdefaults"]
default settings
[coverage:run]
branch = True
source = .
omit =
*/__main__.py
*/setup.py
[coverage:report]
show_missing = True
skip_covered = True
fail_under = 100
exclude_lines =
# a more strict default pragma
\# pragma: no cover\b
# allow defensive code
^\s*raise AssertionError\b
^\s*raise NotImplementedError\b
^\s*return NotImplemented\b
^\s*raise$
# typing-related code
^\s*if (False|TYPE_CHECKING):
: \.\.\.(\s*#.*)?$
^ +\.\.\.$
-> ['"]?NoReturn['"]?:
# non-runnable code
if __name__ == ['"]__main__['"]:$
# additional platform related pragmas (see below)
# additional version related pragmas (see below)
partial_branches =
# a more strict default pragma
\# pragma: no cover\b
# out platform pragmas
\# pragma: (nt|posix|cygwin|darwin|linux|msys|win32|cpython|pypy) (no )?cover\b
# our version pragmas
\# pragma: (>=?|<=?|==|!=)\d+\.\d+ cover\b
platform specific # pragma: no cover
several # pragma: no cover tags will be added automatically based on the
platform and implementation.
these will be in the form of:
# pragma: TAG no cover
or
# pragma: TAG cover