Skip to main content

Module coverage

Module coverage 

Source
Expand description

Coverage rule (Python — issue #26).

Enforces the README’s Coverage rule: a library’s unit suite must meet the configured floor, measured with branch coverage, with test files excluded from the denominator. This module is the deterministic core — given a coverage.py JSON report (CoverageReport) and the Thresholds from config, evaluate decides pass/fail. Producing the report (shelling out to coverage) is a thin layer on top, kept separate so the guarantee is testable without a Python toolchain.

Structs§

CoverageReport
A coverage.py JSON report (coverage json), pared to the totals the check needs. Unmodeled fields (per-file data, metadata) are ignored.
Thresholds
The coverage floor to enforce, from a [<language>].coverage table.
Totals
The totals block of a coverage.py report.

Enums§

Outcome
The result of checking a report against the thresholds.

Functions§

evaluate
Decide whether report meets thresholds.
measure
Run the unit suite under coverage.py in root and check it against thresholds.
parse_report
Parse a coverage.py JSON report (the output of coverage json).