test_total_absence_reports_once_not_twice

Tests › tests/test_coverage.py

passed Passed in the packaged run.

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

  1. files = [(f"src/mod_{n}.c", BIG, 0) for n in range(MIN_SUBSTANTIVE_FILES + 5)]
  2. db_path, root = _coverage_db(tmp_path, files)
→

When

  1. with caplog.at_level(logging.WARNING): report_index_coverage(db_path, root)
  2. warnings = [r.getMessage() for r in caplog.records if r.levelno >= logging.WARNING]
→

Then

  1. ✓ len(warnings) equals 1
  2. ✓ warnings[0] contains "NOT ONE yielded a function body"

tests/test_coverage.py:396 · its file's page

What it checks (2)

  1. assert len(warnings) == 1, warnings not attributed
  2. assert "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

test_total_absence_reports_once_not_twice→_coverage_db→report_index_coverage

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.

test_total_absence_reports_once_not_twice · 2 checksreport_index_coveragewarn_if_no_function_bodiesREQ-DDB-INDEX-001 · measuredreport_index_coveragemeasure_index_coverage_file_yieldsmemoizedREQ-DDB-INDEX-002 · measuredreport_index_coverageREQ-DDB-INDEX-003 · measured
Also reaches 4 requirements

Its run touches their code; that is reach, not proof.