docs: show verified diagnostic and result output in thesis walkthrough

This commit is contained in:
lda
2026-09-14 03:29:18 +07:00 Verified
parent 92642fc218
commit 4268c69877
2 changed files with 96 additions and 57 deletions
@@ -73,4 +73,14 @@ async def test_thesis_python_session_preserves_report_and_repair(
diagnostic = capsys.readouterr().out
assert "invalid_source_path" in diagnostic
assert "output[0].path" in diagnostic
# Marked text blocks are verbatim stdout excerpts, checked against the real
# session so displayed diagnostics/results cannot drift from execution.
displayed_outputs = re.findall(
r"^<!-- walkthrough-output -->\n```text\n(.*?)^```",
chapter,
re.MULTILINE | re.DOTALL,
)
assert len(displayed_outputs) == 2, "Retain the diagnostic and result excerpts"
for displayed in displayed_outputs:
assert displayed in diagnostic, "Displayed output differs from the session"
assert namespace["trace"].frames