test_build_fills_only_what_doxygen_left_bare¶
Tests › tests/test_pydocs.py
What this test is for
Why it exists
The test says nothing about why.
Given
repo = tmp_path / "repo"(repo / "pkg").mkdir(parents=True)
2 more
(repo / "pkg" / "mod.py").write_text(SRC, encoding="utf-8")out = tmp_path / "clew.db"
When
_run_pipeline(_build_argparser().parse_args(["--output", str(out), "--repo-root", str(repo)]))conn = sqlite3.connect(out)rows = { name: (strip_xml(brief), extract_version(detail), source) for name, brief, detail, source in conn.execute( "SELECT name, briefdescription, detaileddescription, dg_source FROM memberdef " "WHERE kind='function'" ) }
3 more
classes = dict( conn.execute("SELECT name, briefdescription FROM compounddef WHERE kind='class'") )strip_xml(classes["mod::Thing"])req = conn.execute( "SELECT COUNT(*) FROM memberdef WHERE name='pep' AND detaileddescription LIKE '%REQ-X-001%'" ).fetchone()[0]
Then
- ✓ rows["doxy"] equals ("Doxygen-documented.", "4", "doxygen")
- ✓ rows["pep"] equals ("Return the answer.", "2", "doxygen")
- ✓ rows["method"][0] equals "Do the thing."
- ✓ rows["bare"][0] equals ""
- ✓ strip_xml(classes["mod::Thing"]) equals "A documented class."
- ✓ req equals 1
What it exercises
The parts of the system's flows this test ran, measured by per-test coverage: lit steps ran in this test, dimmed ones did not, and ▶ marks where the test called in. Each title opens the whole flow with these steps lit.
clew — `main` (clew/cli.py) · 31 of 400 steps
… 10 earlier steps
… 26 steps between
… 4 steps between
… 23 steps between
… 57 steps between
… 27 steps between
… 190 later steps
6 more
- thread `clew-first-build-` — `_first_build_worker` (clew/mcp_server/server.py) · 27 of 142 steps
- Build, refresh and check the index · 21 of 153 steps
- `main` (clew/guard/main.py) · 12 of 357 steps
- Build this wiki from the index · 6 of 400 steps
- clew-mcp — `main` (clew/mcp_server/server.py) · 1 of 17 steps
- `main` (scripts/incremental_probe.py) · 1 of 3 steps
tests/test_pydocs.py:85 · its file's page
What it checks (6)
assert rows["doxy"] == ("Doxygen-documented.", "4", "doxygen"), "a ## block is never replaced"observesstrip_xmlviarowsassert rows["pep"] == ("Return the answer.", "2", "doxygen")observesstrip_xmlviarowsassert rows["method"][0] == "Do the thing."observesstrip_xmlviarowsassert rows["bare"][0] == "", "no docstring, nothing invented"observesstrip_xmlviarowsassert strip_xml(classes["mod::Thing"]) == "A documented class."observesstrip_xmlassert req == 1, ( "the @req stays in doxygen's verbatim detail, where the requirements pass reads it" )not attributed
Where the product reaches it
build_wiki→_build_site→test_pages→_briefs→strip_xml(flow)
Call flow
test_build_fills_only_what_doxygen_left_bare→_run_pipeline→_build_argparser→strip_xml→extract_versionWhat 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.
and 42 more requirement paths, listed below.
Also reaches 55 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-CLI-001 measured
- REQ-DDB-CLI-002 inferred
- REQ-DDB-CONFIG-001 measured
- REQ-DDB-CONFIG-003 inferred
- REQ-DDB-CONFIG-004 measured
- REQ-DDB-CONFIG-005 measured
- REQ-DDB-CONFIG-006 measured
- REQ-DDB-CONFIG-007 measured
- REQ-DDB-CONFIG-009 measured
- REQ-DDB-GUARD-012 inferred
- REQ-DDB-GUARD-019 measured
- REQ-DDB-GUARD-024 measured
- REQ-DDB-INDEX-001 measured
- REQ-DDB-INDEX-002 measured
- REQ-DDB-INDEX-003 measured
- REQ-DDB-INDEX-004 measured
- REQ-DDB-INDEX-005 measured
- REQ-DDB-INDEX-006 measured
- REQ-DDB-INDEX-007 measured
- REQ-DDB-INDEX-008 measured
- REQ-DDB-INDEX-009 measured
- REQ-DDB-INDEX-010 measured
- REQ-DDB-INDEX-011 measured
- REQ-DDB-MCP-001 measured
- REQ-DDB-MCP-004 measured
- REQ-DDB-PIPE-001 measured
- REQ-DDB-PIPE-003 measured
- REQ-DDB-PIPE-004 measured
- REQ-DDB-PIPE-005 measured
- REQ-DDB-PIPE-006 measured
- REQ-DDB-PIPE-007 measured
- REQ-DDB-PIPE-008 measured
- REQ-DDB-PIPE-009 measured
- REQ-DDB-PIPE-010 measured
- REQ-DDB-PIPE-011 measured
- REQ-DDB-PIPE-012 measured
- REQ-DDB-PIPE-013 measured
- REQ-DDB-PIPE-014 measured
- REQ-DDB-PIPE-015 measured
- REQ-DDB-QUERY-003 measured
- REQ-DDB-QUERY-011 measured
- REQ-DDB-SCHEMA-001 measured
- REQ-DDB-SCHEMA-002 measured
- REQ-DDB-SCHEMA-003 measured
- REQ-DDB-SCHEMA-004 measured
- REQ-DDB-SCHEMA-005 measured
- REQ-DDB-SCHEMA-006 measured
- REQ-DDB-SCHEMA-007 measured
- REQ-DDB-SCHEMA-009 measured
- REQ-DDB-SCHEMA-011 measured
- REQ-DDB-SCHEMA-012 measured
- REQ-DDB-SCHEMA-013 measured
- REQ-DDB-SCHEMA-014 measured
- REQ-DDB-SCHEMA-015 measured
- REQ-DDB-WIKI-054 inferred