covdefaults
A coverage plugin to provide sensible default settings
What it is and what it does
covdefaults is a plugin for the coverage tool that injects a curated set of default coverage settings so you don't have to configure them manually. When activated, it sets branch tracking on, establishes a 100% coverage threshold, and pre-defines exclusion rules for common non-testable patterns like `if __name__ == '__main__'`, type-checking blocks, and platform-specific code paths.
The plugin also generates automatic pragma tags based on your runtime environment—marking code as excluded if it targets a different platform (Windows vs. Linux) or Python version than the one running tests. You can override or extend any of these defaults in your own coverage configuration; the plugin respects manually set values and allows you to add or subtract from its omit and exclude lists.
Use it for:
- Enforce 100% branch coverage across a project without manually configuring coverage thresholds and exclusion patterns.
- Automatically exclude platform-specific code branches (Windows vs. POSIX, CPython vs. PyPy) from coverage reports.
- Skip version-gated code (e.g., Python 3.9+ features) from coverage when testing on older Python versions.
- Reduce boilerplate in .coveragerc by inheriting sensible defaults for show_missing, skip_covered, and exclude_lines.
- Maintain consistent coverage settings across multiple projects by relying on a shared plugin rather than duplicating configuration.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A coverage plugin that automatically applies sensible default settings for code coverage measurement, including branch tracking, strict thresholds, and platform/version-aware exclusion rules.
Yes, if you want strict, opinionated coverage defaults with minimal setup. The plugin is actively maintained, has no known vulnerabilities, and low install friction. It's most valuable for projects that already target 100% coverage or want to enforce it; teams preferring lower thresholds or highly custom exclusion rules may find the defaults constraining and should verify they can override them to your satisfaction.
Install
covdefaults on PyPI
pip
pip install covdefaultsuv
uv add covdefaultspoetry
poetry add covdefaultsInstalling covdefaults
Before you install
Low friction: pure Python wheel with a single runtime dependency on coverage. Actively maintained as of 2026-07-15 with 87 repository stars.
License in practice
MIT license permits commercial and private use with minimal restrictions; you must retain the license notice in distributions.
Quickstart
pip install covdefaults
Then add to .coveragerc, setup.cfg, or pyproject.toml:
[coverage:run]
plugins = covdefaults
The plugin activates automatically when coverage runs.
Requires coverage to be installed and configured; the plugin only applies defaults when coverage is invoked.
Verify before relying
- Whether the plugin's default fail_under = 100 threshold is appropriate for typical project workflows.
- How the plugin interacts with existing coverage configuration when both defaults and user settings overlap.
- Performance impact when processing platform and version-specific pragma tags on large codebases.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.7) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — coverage |
| Maintenance | actively maintained — 1,258 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 616,728/month — #5,740 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: covdefaults-2.3.0-py2.py3-none-any.whl
Tags
More Quality Assurance packages
Coverage.py measures which lines of Python code…
permissive · top 1,000 on PyPI
ruffRuff is a Python linter and code formatter…
permissive · top 1,000 on PyPI
pexpectPexpect spawns and controls interactive console…
permissive · top 1,000 on PyPI
blackBlack reformats Python source code to a…
permissive · top 1,000 on PyPI
pytest-xdistpytest-xdist distributes pytest tests across…
permissive · top 1,000 on PyPI
cfn-lintValidates AWS CloudFormation templates in YAML…
permissive · top 1,000 on PyPI
coverage-conditional-pluginA coverage.py plugin that applies conditional…
permissive · top 15,000 on PyPI
coverage_enable_subprocessInstalls a .pth file that automatically enables…
permissive · top 15,000 on PyPI
pytest-coverpytest-cover is a pytest plugin for measuring…
permissive · top 15,000 on PyPI
slipcoverSlipCover is a fast code coverage tool that…
permissive · top 15,000 on PyPI
pytest-covA pytest plugin that measures code coverage…
permissive · top 1,000 on PyPI
django-coverage-pluginA coverage.py plugin that measures test…
permissive · top 5,000 on PyPI
coverage-badgeGenerates SVG coverage badges from Coverage.py…
permissive · top 15,000 on PyPI
interrogateInterrogate scans a Python codebase to measure…
permissive · top 5,000 on PyPI
mutmutMutmut is a mutation testing system for Python…
permissive · top 5,000 on PyPI
coverage-thresholdValidates Python code coverage against…
permissive · top 15,000 on PyPI