test_a_failing_assertion_is_the_failure_point¶
Tests › tests/test_wiki_tracerun.py
What this test is for
Why it exists
The test span is an error, carrying the assertion's line and message.
Verifies REQ-DDB-WIKI-036 REQ-DDB-WIKI-049
Given
- —
When
run = trace_test(repo, "tests/test_m.py::test_broken")test_span = next(s for s in spans_of(run["otlp"]) if s["name"] == "test_broken")event = next(e for e in test_span["events"] if e["name"] == "exception")detail = _attrs(event)
Then
- ✓ run["passed"] is False
- ✓ test_span["status"]["code"] equals 2
- ✓ detail["code.lineno"] equals "13"
- ✓ detail["exception.message"] contains "parse doubled it"
- ✓ run["checkpoints"] equals [ {"line": 13, "text": 'assert got == [7], "parse doubled it"', "outcome": "failed"} ]
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.
Build this wiki from the index · 35 of 400 steps
… 7 steps between
… 343 later steps
tests/test_wiki_tracerun.py:99 · its file's page
What it checks (4)
assert run["passed"] is Falseobservestrace_testviarunassert test_span["status"]["code"] == 2observesspans_ofviatest_spanassert detail["code.lineno"] == "13" and "parse doubled it" in detail["exception.message"]observes_attrsviadetailassert run["checkpoints"] == [ {"line": 13, "text": 'assert got == [7], "parse doubled it"', "outcome": "failed"} ]observestrace_testviarun
Where the product reaches it
build_wiki→_build_site→root_name→spans_of(flow)
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 (2)
| requirement | linked by | implementers exercised |
|---|---|---|
| REQ-DDB-WIKI-036 | catalog | unknown |
| REQ-DDB-WIKI-049 | catalog | unknown |
Also reaches 4 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-GUARD-012 inferred
- REQ-DDB-WIKI-026 measured
- REQ-DDB-WIKI-035 measured
- REQ-DDB-WIKI-054 inferred