Coverage
parse_coverage_xml(path: Union[str, Path], metric: str = 'line') -> float
¶
Parse a coverage.xml report and return coverage as a percentage.
| PARAMETER | DESCRIPTION |
|---|---|
|
Path to the
TYPE:
|
|
Which coverage metric to read.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
float
|
Coverage percentage in the range 0.0–100.0. |
| RAISES | DESCRIPTION |
|---|---|
FileNotFoundError
|
If path does not exist. |
ValueError
|
If metric is not |
ParseError
|
If the XML is malformed. NOT a |
Source code in src/badgeshield/coverage.py
coverage_color(pct: float) -> str
¶
Return a hex color for the given coverage percentage.