mirror of
https://github.com/elder-plinius/OBLITERATUS.git
synced 2026-08-18 00:47:23 +02:00
test: reject malformed coverage metrics
This commit is contained in:
@@ -4,6 +4,7 @@ from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import json
|
||||
import math
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
@@ -23,7 +24,11 @@ def validate_coverage(
|
||||
)
|
||||
for label, key, minimum in metrics:
|
||||
value = totals.get(key)
|
||||
if not isinstance(value, (int, float)):
|
||||
if (
|
||||
isinstance(value, bool)
|
||||
or not isinstance(value, (int, float))
|
||||
or not math.isfinite(value)
|
||||
):
|
||||
failures.append(f"coverage report is missing numeric {key}")
|
||||
elif value < minimum:
|
||||
failures.append(
|
||||
|
||||
Reference in New Issue
Block a user