test_installed_code_inside_the_repository_is_never_a_span

Tests › tests/test_wiki_tracerun.py

passed Passed in the packaged run.

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.

Verifies REQ-DDB-WIKI-035 REQ-DDB-WIKI-036 REQ-DDB-WIKI-049

Given

  1. root = tmp_path / "repo"
  2. rec = _Recorder(root, root / "tests" / "test_m.py", "test_m")
3 more
  1. 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)
  2. site = str(root / ".venv/lib/python3.10/site-packages/_pytest/python.py")
  3. prefixed = str(Path(sys.prefix) / "lib" / "x.py")
→

When

  1. —
→

Then

  1. ✓ rec.tracer(frame(site, "pytest_runtest_call"), "call", None) is None
  2. ✓ rec.tracer(frame(prefixed, "f"), "call", None) is None
  3. ✓ rec.stack equals []

tests/test_wiki_tracerun.py:347 · its file's page

What it checks (3)

  1. assert rec.tracer(frame(site, "pytest_runtest_call"), "call", None) is None not attributed
  2. assert rec.tracer(frame(prefixed, "f"), "call", None) is None not attributed
  3. assert 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)

requirementlinked byimplementers exercised
REQ-DDB-WIKI-035catalogunknown
REQ-DDB-WIKI-036catalogunknown
REQ-DDB-WIKI-049catalogunknown