test_self_directed_sites_reads_shape_not_name¶
Tests › tests/test_self_edges.py
What this test is for
Why it exists
Unit-level statement of the rule the mechanisms above exercise: a bare call and a `self.`-rooted call are self-directed; `self.conn.close()`, `super().__init__()` and `::close()` are not.
Given
tree, src = _parse(tmp_path, "fixture.py", _PY_FIXTURE)
When
names = {name for name, _line in _self_directed_sites(tree, src)}tree, src = _parse(tmp_path, "fixture.cpp", _CPP_FIXTURE)names = {name for name, _line in _self_directed_sites(tree, src)}
Then
- ✓ {"descend", "walk"} is at most names
- ✓ names does not contain "close"
- ✓ names does not contain "__init__"
- ✓ {"walk", "brace_expand", "log_warn"} is at most names
- ✓ names does not contain "close"
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_self_edges.py:515 · its file's page
What it checks (5)
assert {"descend", "walk"} <= namesobserves_self_directed_sitesvianamesassert "close" not in names, "self.conn.close() has a receiver of its own"observes_self_directed_sitesvianamesassert "__init__" not in names, "super().__init__() is not rooted at self"observes_self_directed_sitesvianamesassert {"walk", "brace_expand", "log_warn"} <= namesobserves_self_directed_sitesvianamesassert "close" not in names, "::close() is the global-scope function"observes_self_directed_sitesvianames
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
test_self_directed_sites_reads_shape_not_name→_self_directed_sitesWhat 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-PIPE-003 measured
- REQ-DDB-PIPE-011 measured