test_python_recovers_functions_and_still_no_module_variables¶
Tests › tests/test_ast_symbols.py
What this test is for
Why it exists
INVERTED, NOT DELETED (gh#397). This test used to assert that Python is REFUSED, on the ground its own name gave: "because doxygen already indexes it". Its docstring said "Pinned so that enabling Python later is a decision rather than a side effect" — this is that decision, and the premise it rested on was MEASURED FALSE:
Given
src = b"TOP_LEVEL = 3\n\n\ndef top():\n return 1\n"tree = SubstrateParser("python").parse(src)payload = _FunctionDefinitionHarvester().harvest(tree, src)
When
- —
Then
- ✓ [row[0] for row in payload.get(_PAYLOAD_FUNCTIONS, [])] equals ["top"]
- ✓ payload.get(_PAYLOAD_VARIABLES, []) equals []
tests/test_ast_symbols.py:665 · its file's page
What it checks (2)
assert [row[0] for row in payload.get(_PAYLOAD_FUNCTIONS, [])] == ["top"]not attributedassert payload.get(_PAYLOAD_VARIABLES, []) == [], ( "TOP_LEVEL is a module-level assignment doxygen already indexes; recovering it " "would double-count every Python constant in the repo" )not attributed
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-003 measured