test_a_prose_file_is_not_counted_as_barren¶
Tests › tests/test_coverage.py
What this test is for
Why it exists
A markdown file is not barren; it is not code.
Given
docs = [(f"docs/guide_{n}.md", BIG, 0) for n in range(MIN_SUBSTANTIVE_FILES + 5)]db_path, root = _coverage_db(tmp_path, docs, prose=tuple(name for name, _, _ in docs))
When
coverage = measure_index_coverage(db_path, root)
Then
- ✓ coverage.indexed_files equals 0
- ✓ coverage.barren_files equals 0
- ✓ coverage.alarming is false
tests/test_coverage.py:225 · its file's page
What it checks (3)
assert coverage.indexed_files == 0, "prose-yielding files are not code and are excluded"observesmeasure_index_coverageviacoverageassert coverage.barren_files == 0observesmeasure_index_coverageviacoverageassert not coverage.alarmingobservesmeasure_index_coverageviacoverage
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 2 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-INDEX-002 inferred
- REQ-DDB-INDEX-003 measured