covdefaults

2.3.0 · active · verified Tue Apr 14

covdefaults is a coverage.py plugin that provides sensible, opinionated default settings to streamline test coverage configuration. It automatically sets defaults for aspects like branch coverage, source directory, common file omission patterns, and reporting options (e.g., `show_missing=True`, `fail_under=100`). The current version is 2.3.0, released on March 5, 2023, and it maintains an active release cadence.

Warnings

Install

Imports

Quickstart

To enable covdefaults, add it to the `plugins` list in your `pyproject.toml` (or `.coveragerc`, `setup.cfg`, `tox.ini`). This example assumes a Poetry project with pytest and coverage installed. covdefaults will then apply its default settings for coverage measurement and reporting. You can override specific defaults by explicitly setting them in your coverage configuration.

pyproject.toml

[tool.poetry]
name = "my-project"
version = "0.1.0"
description = ""
authors = ["Your Name <you@example.com>"]
readme = "README.md"

[tool.poetry.dependencies]
python = ">=3.7,<4.0"
coverage = {extras = ["toml"], version = ">=6.0.2"}

[tool.poetry.group.dev.dependencies]
pip = "*"
pytest = "*"
covdefaults = "*"

[tool.coverage.run]
plugins = ["covdefaults"]

# Optional: Customize or override specific defaults
# source = ["."]
# omit = [".venv/*"]

# Optional: Customize reporting
# [tool.coverage.report]
# fail_under = 90

view raw JSON →