From 52bf40de4f270e891ace2228dd6d2bb063b5552a Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Sat, 8 Aug 2026 18:58:37 -0400 Subject: [PATCH] =?UTF-8?q?test:=20the=20empty=20duplicate=20report=20carr?= =?UTF-8?q?ies=20suggestion=20now=20=E2=80=94=20assert=20shape,=20not=20th?= =?UTF-8?q?e=20exact=20dict?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The step-5 field addition (d7039dc) broke a test pinning the error-path return literally. The field is deliberate: a failed scan must match a clean scan in shape, or every consumer grows a second code path for the degraded case. Assert the parts instead. Refs #2547 --- tests/test_snippet_duplicates.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/test_snippet_duplicates.py b/tests/test_snippet_duplicates.py index 6458fa7..3021a52 100644 --- a/tests/test_snippet_duplicates.py +++ b/tests/test_snippet_duplicates.py @@ -96,4 +96,9 @@ async def test_a_failed_scan_returns_an_empty_report_not_an_error(): patch.object(dedup_svc, "async_session", side_effect=RuntimeError("boom")), ): out = await dedup_svc.find_duplicate_snippets(1) - assert out == {"groups": [], "pairs": [], "threshold": 0.8} + # The empty report still carries its per-kind `suggestion` (#2547) — a + # failed scan must be indistinguishable in SHAPE from a clean one, or every + # consumer needs a second code path for the degraded case. + assert out["groups"] == [] and out["pairs"] == [] + assert out["threshold"] == 0.8 + assert "merge" in out["suggestion"]