From 67607a0543c6de1f22a22342a3e5af5a5f1ab25e Mon Sep 17 00:00:00 2001 From: Patrick <320190286+muellerei@users.noreply.github.com> Date: Sat, 3 Oct 2026 05:06:13 +0200 Subject: [PATCH] Make the live-ref check in test_dead_block_refs able to fail test_page_without_dead_refs_says_nothing searched stderr for "dead", but the notice reads "points at a block that no longer exists", so the check could never fail. The JSON check beside it does not cover the notice either: a live ref reported as dead is inlined before the payload is built, so the payload stays clean while stderr carries the claim. Checking for the notice's wording would go blind the same way the day the message is reworded, and no other test in the file pins that wording; they look for the uuid. The test now asserts that stderr is empty, which is what its name claims. With a live ref added to the dead list, the empty-page guard removed and the message reworded, the old assertion, a wording check and the JSON check all pass; the new assertion fails. test_without_resolve_refs_nothing_is_claimed keeps its wording check: its get_block.assert_not_called() already fails for every regression I could construct there, so no mutation separates a rewritten check from it. --- tests/test_dead_block_refs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_dead_block_refs.py b/tests/test_dead_block_refs.py index d80cf29..3999d77 100644 --- a/tests/test_dead_block_refs.py +++ b/tests/test_dead_block_refs.py @@ -82,7 +82,7 @@ def test_page_without_dead_refs_says_nothing(self, api): {"uuid": "b1", "content": f"see (({LIVE}))", "children": []}] result = split_runner().invoke( cli, ["get-page", "--page", "Page", "--resolve-refs", "--json"]) - assert "dead" not in result.stderr.lower(), result.stderr + assert result.stderr == "" assert "dead_refs" not in json.loads(result.stdout) def test_without_resolve_refs_nothing_is_claimed(self, api):