test_total_absence_reports_once_not_twice¶
Tests › tests/test_coverage.py
What this test is for
Why it exists
The two terms COMPOSE rather than compete. A build that extracted literally nothing satisfies both the total-absence check and the barren-ratio check, and must produce ONE precise message — the one that names PREDEFINED — instead of two overlapping ones that train the reader to skim.
Given
files = [(f"src/mod_{n}.c", BIG, 0) for n in range(MIN_SUBSTANTIVE_FILES + 5)]db_path, root = _coverage_db(tmp_path, files)
When
with caplog.at_level(logging.WARNING): report_index_coverage(db_path, root)warnings = [r.getMessage() for r in caplog.records if r.levelno >= logging.WARNING]
Then
- ✓ len(warnings) equals 1
- ✓ warnings[0] contains "NOT ONE yielded a function body"
tests/test_coverage.py:396 · its file's page
What it checks (2)
assert len(warnings) == 1, warningsnot attributedassert "NOT ONE yielded a function body" in warnings[0]not attributed
Where the product reaches it
No product flow reaches this code: no product entry point's flow calls any of the functions this test calls.
Call flow
What it reaches
Each row runs from this test, through the calls it makes, to the code a requirement names. If that code breaks, the test's checks are what should catch it. Reaching is not proving: a check only proves what it observes. No mutation records were given, so these rows say what the test REACHES.
Also reaches 4 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-INDEX-001 measured
- REQ-DDB-INDEX-002 measured
- REQ-DDB-INDEX-003 measured
- REQ-DDB-INDEX-004 measured