test_installed_code_inside_the_repository_is_never_a_span¶
Tests › tests/test_wiki_tracerun.py
What this test is for
Why it exists
FOUND TRACING CLEW'S OWN TESTS (round 4): clew's `.venv` sits inside the repository, so pytest's own `pytest_runtest_call` (site-packages) became the root span and the 20,000-span cap filled with pytest internals. A frame in site-packages, or under the running interpreter's prefix, is installed code — not the repository's — however its path begins.
Given
root = tmp_path / "repo"rec = _Recorder(root, root / "tests" / "test_m.py", "test_m")
3 more
def frame(path: str, name: str) -> SimpleNamespace: code = SimpleNamespace(co_filename=path, co_name=name, co_firstlineno=1) return SimpleNamespace(f_code=code, f_locals={}, f_lineno=1)site = str(root / ".venv/lib/python3.10/site-packages/_pytest/python.py")prefixed = str(Path(sys.prefix) / "lib" / "x.py")
When
- —
Then
- ✓ rec.tracer(frame(site, "pytest_runtest_call"), "call", None) is None
- ✓ rec.tracer(frame(prefixed, "f"), "call", None) is None
- ✓ rec.stack equals []
tests/test_wiki_tracerun.py:347 · its file's page
What it checks (3)
assert rec.tracer(frame(site, "pytest_runtest_call"), "call", None) is Nonenot attributedassert rec.tracer(frame(prefixed, "f"), "call", None) is Nonenot attributedassert rec.stack == []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.
Requirements it verifies (3)
| requirement | linked by | implementers exercised |
|---|---|---|
| REQ-DDB-WIKI-035 | catalog | unknown |
| REQ-DDB-WIKI-036 | catalog | unknown |
| REQ-DDB-WIKI-049 | catalog | unknown |