From 4c7c627e515fe1876a0477daedac419b68b15599 Mon Sep 17 00:00:00 2001 From: Chris Coutinho Date: Wed, 17 Jun 2026 23:14:05 +0200 Subject: [PATCH] =?UTF-8?q?test(integration):=20address=20round-6=20review?= =?UTF-8?q?=20=E2=80=94=20clearer=20skip=20&=20assert=20message?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - test_no_results_for_unrelated_query: use pytest.skip when the nonsense query returns nothing (the ideal outcome) so the report shows the path was taken, instead of a bare return appearing as a silent pass. - _top_score: include result.content in the isError assertion message for faster failure diagnosis. Co-Authored-By: Claude Opus 4.8 (1M context) --- tests/integration/test_rag.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/integration/test_rag.py b/tests/integration/test_rag.py index ea55a7a5..aaf99fd8 100644 --- a/tests/integration/test_rag.py +++ b/tests/integration/test_rag.py @@ -411,7 +411,7 @@ async def _top_score(nc_mcp_client: Any, query: str) -> float | None: "nc_semantic_search", arguments={"query": query, "limit": 5, "score_threshold": 0.0}, ) - assert result.isError is False + assert result.isError is False, result.content data = json.loads(result.content[0].text) results = data.get("results", []) if not results: # guard the list directly, not via total_found @@ -436,7 +436,9 @@ async def test_no_results_for_unrelated_query(nc_mcp_client, indexed_manual_pdf) nc_mcp_client, "quantum entanglement hadron collider particle physics" ) if unrelated is None: - return # No results for nonsense query — the ideal outcome. + # No results for the nonsense query is the ideal outcome; skip (rather + # than a silent pass) so the test report shows the path was taken. + pytest.skip("No results for nonsense physics query — the ideal outcome") relevant = await _top_score( nc_mcp_client, "how do I enable two-factor authentication"