test_catch2_section_cases_fold_into_their_test_case

Tests › tests/test_wiki_frameworks.py

passed Passed in the packaged run.

What this test is for

Why it exists

FOUND ON SASSAFRAS-CLASS (round 4): Catch2's own JUnit reporter writes one testcase per SECTION PATH ("Scenario: X/Given: a/When: b"), under classname `<binary>.global`; the index knows the test case ("Scenario: X"), so 230 of 267 tested requirements read NOT_RUN. Section cases fold into their test case, worst status first — and a FAILURE keeps its message, which a test page shows in red (only skip messages were kept).

Verifies REQ-DDB-WIKI-017

Given

  1. report = tmp_path / "catch2.xml"
  2. report.write_text( '<testsuites><testsuite name="t">' '<testcase classname="t.global" name="Scenario: X/Given: a" status="run"/>' '<testcase classname="t.global" name="Scenario: X/Given: a/When: b" status="run">' '<failure message="REQUIRE( n == 2 )">expanded: 1 == 2</failure></testcase>' '<testcase classname="t.global" name="Scenario: Y" status="run"/>' "</testsuite></testsuites>" )
→

When

  1. results = parse_junit([report])
→

Then

  1. ✓ set(results) equals {"Scenario: X", "Scenario: Y"}
  2. ✓ results["Scenario: X"].status equals "failed"
  3. ✓ results["Scenario: X"].cases equals 2
  4. ✓ results["Scenario: X"].message contains "REQUIRE( n == 2 )"

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 · 7 of 400 steps

… 344 earlier steps

callercallercallercallerclew/wiki/build.pyclew/wiki/build.pyclew/wiki/build.pyclew/wiki/build.pyother filesother filesother filesother filesbuild_wiki345. slice_svg → _hidden345_hidden346. _build_site → parse_junit346parse_junit347. parse_junit → fold_cases347fold_cases▶ test enters348. fold_cases → _folded348_folded349–353. parse_junit → _case_name349_case_name +4 more354. _build_site → _lines_by_test354_lines_by_test355. _lines_by_test → lines_per_test355lines_per_test

… 45 later steps

tests/test_wiki_frameworks.py:176 · its file's page

What it checks (3)

  1. assert set(results) == {"Scenario: X", "Scenario: Y"} observes parse_junit via results
  2. assert results["Scenario: X"].status == "failed" and results["Scenario: X"].cases == 2 observes parse_junit via results
  3. assert "REQUIRE( n == 2 )" in results["Scenario: X"].message observes parse_junit via results

Where the product reaches it

  • build_wiki → _build_site → parse_junit (flow)

Call flow

test_catch2_section_cases_fold_into_their_test_case→parse_junit

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.

test_catch2_section_cases_fold_into_their_test_case · 3 checksparse_junitREQ-DDB-WIKI-002 · measuredparse_junitfold_casesREQ-DDB-WIKI-010 · measured

Requirements it verifies (1)

requirementlinked byimplementers exercised
REQ-DDB-WIKI-017catalogunknown
Also reaches 2 requirements

Its run touches their code; that is reach, not proof.