docs: show verified diagnostic and result output in thesis walkthrough
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user