coverage-threshold
Tools for coverage threshold limits
What it is and what it does
coverage-threshold is a command-line tool that enforces code coverage standards by reading JSON reports from Python's coverage tool and comparing them against configurable minimum thresholds. It supports both global coverage minimums (line, branch, or combined) and per-file thresholds, with the ability to override defaults for specific modules or files via TOML configuration.
The tool is designed to integrate into test workflows as a gating step—run your tests with coverage, generate a JSON report, then invoke coverage-threshold to verify the results meet your project's standards. Configuration lives in pyproject.toml by default, allowing thresholds to be version-controlled alongside your code. It has a single runtime dependency (toml) and supports Python 3.7 and later.
Use it for:
- Enforce minimum line coverage across a codebase in CI pipelines to prevent coverage regressions.
- Set different per-file thresholds for critical modules while allowing lower coverage in less critical code.
- Validate that coverage.json reports meet organizational standards before merging pull requests.
- Configure module-specific coverage rules using path prefixes to handle varying quality requirements across a project.
- Gate test suite completion on coverage thresholds without requiring external CI/CD platform features.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Validates Python code coverage against configurable minimum thresholds at both global and per-file levels, reading from coverage.json and configuration files.
Yes, if you need to enforce coverage minimums in your test workflow. The tool is straightforward, has minimal dependencies, and integrates cleanly with the standard coverage tool. The aging maintenance status (446 days since last release) is a minor concern for a stable utility, but the repository remains active and the package supports current Python versions. No known vulnerabilities.
Install
coverage-threshold on PyPI
pip
pip install coverage-thresholduv
uv add coverage-thresholdpoetry
poetry add coverage-thresholdInstalling coverage-threshold
Before you install
Low install friction with a single lightweight dependency (toml). Repository is aging (446 days since last release) but not archived; last commit was recent. Supports Python 3.7 through 3.13.
License in practice
MIT license is permissive and imposes no restrictions on use, modification, or distribution in proprietary or open-source projects.
Quickstart
pip install coverage-threshold
# After running coverage json:
coverage-threshold --line-coverage-min 95
# Or with config file (pyproject.toml):
coverage-threshold
Requires a coverage.json file generated by the coverage tool; typically run after coverage json in a test workflow.
Verify before relying
- Whether per-module threshold configuration supports glob patterns or only exact path prefixes as documented.
- Whether the tool integrates with CI/CD systems or requires manual invocation in pipeline steps.
- Performance characteristics when validating coverage for 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 — toml |
| Maintenance | aging — 446 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 110,849/month — #12,440 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: coverage_threshold-0.6.2-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
xenonXenon monitors Python code complexity by…
permissive · top 5,000 on PyPI
slipcoverSlipCover is a fast code coverage tool that…
permissive · top 15,000 on PyPI
spm-calculatorCalculate Supplemental Poverty Measure (SPM)…
permissive · top 15,000 on PyPI
pytest-fail-slowA pytest plugin that marks tests as failed if…
permissive · top 15,000 on PyPI
validate-pyprojectValidates pyproject.toml files against JSON…
copyleft · top 15,000 on PyPI
covdefaultsA coverage plugin that automatically applies…
permissive · top 15,000 on PyPI
tachTach enforces module boundaries, dependency…
permissive · top 5,000 on PyPI
iregexp-checkValidates regular expressions against RFC 9485…
permissive · top 15,000 on PyPI
mypy-strict-kwargsA mypy plugin that enforces…
permissive · top 15,000 on PyPI
oslo.limitoslo.limit enforces quota and rate limits…
permissive · top 15,000 on PyPI