test_python_module_docstring_is_the_file_documentation¶
Tests › tests/test_filedocs.py
What this test is for
Why it exists
Uses the AST rather than a regex, so the SPDX comment above the docstring and the `from __future__` import below it are both non-events.
Verifies REQ-DDB-SCHEMA-014
Given
- —
When
doc = extract_file_doc("clew/callback_edges.py", PY_SOURCE)
Then
- ✓ doc contains "function-pointer calls"
- ✓ doc contains "callback assignment"
- ✓ doc does not contain "SPDX"
- ✓ doc does not contain "Do it."
- ✓ doc does not contain "\n"
tests/test_filedocs.py:72 · its file's page
What it checks (5)
assert "function-pointer calls" in docobservesextract_file_docviadocassert "callback assignment" in docobservesextract_file_docviadocassert "SPDX" not in doc, "a `#` comment is not the module docstring"observesextract_file_docviadocassert "Do it." not in doc, "a FUNCTION docstring is not the file's documentation"observesextract_file_docviadocassert "\n" not in docobservesextract_file_docviadoc
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.
Requirements it verifies (1)
| requirement | linked by | implementers exercised |
|---|---|---|
| REQ-DDB-SCHEMA-014 | catalog | unknown |
Also reaches 1 requirement
Its run touches their code; that is reach, not proof.
- REQ-DDB-PIPE-008 measured