Skip to main content

Code coverage validation

Project description

covcheck

Command-line tool for code coverage validation.

covcheck is intended to be used in conjunction with coverage.py, which already has support for pytest, unittest, and nosetest. All you have to do is point covcheck to the coverage.xml file produced when running your tests.

Installation

$ pip install coverage
$ pip install covcheck

Usage

1. Produce a coverage.xml file while running your tests:

# pytest
$ coverage run --branch -m pytest ...
$ coverage xml

# unittest
$ coverage run --branch -m unittest ...
$ coverage xml

# nosetest
$ coverage run --branch -m nose ...
$ coverage xml

2. Validate that line and branch coverage meet the provided thresholds:

$ covcheck coverage.xml --line 96 --branch 84

Configuration

Arguments passed through the command-line can also be configured with a pyproject.toml file.

$ covcheck coverage.xml --config pyproject.toml
# pyproject.toml

[tool.covcheck]
line = 92.0
branch = 79.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

covcheck-0.4.0.tar.gz (7.3 kB view hashes)

Uploaded Source

Built Distribution

covcheck-0.4.0-py3-none-any.whl (9.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page