test_every_annotated_class_attribute_is_harvested¶
Tests › tests/test_python_class_fields.py
What this test is for
Why it exists
Harvests ALL of them, not only the ones doxygen dropped. Which rows are already present is a question about the DATABASE, and answering it here would put the dedup rule in the parser where it cannot see the index — the same split `harvest_variable_declarations` already keeps from `_recoverable_variables`.
Given
tree, src = _parse(tmp_path)
When
got = {(f.class_name, f.name): f for f in harvest_python_class_fields(tree, src)}
Then
- ✓ {k[1] for k in got} equals { "bare_str", "bare_int", "bare_union", "with_default", "class_level_bare", "class_level_assigned", }
- ✓ got[("Shapes", "bare_union")].type_text equals "int | None"
- ✓ got[("Shapes", "with_default")].type_text equals "str"
- ✓ got[("Plain", "class_level_bare")].class_name equals "Plain"
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) · 7 of 400 steps
… 70 earlier steps
… 313 later steps
tests/test_python_class_fields.py:91 · its file's page
What it checks (4)
assert {k[1] for k in got} == { "bare_str", "bare_int", "bare_union", "with_default", "class_level_bare", "class_level_assigned", }, sorted(k[1] for k in got)observesharvest_python_class_fieldsviagotassert got[("Shapes", "bare_union")].type_text == "int | None"observesharvest_python_class_fieldsviagotassert got[("Shapes", "with_default")].type_text == "str"observesharvest_python_class_fieldsviagotassert got[("Plain", "class_level_bare")].class_name == "Plain"observesharvest_python_class_fieldsviagot
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-004 measured
- REQ-DDB-PIPE-011 measured