From 31b8a5030b76e5d15724512c19b72f29eeac0b8a Mon Sep 17 00:00:00 2001 From: Alexander Whitestone Date: Mon, 23 Mar 2026 22:28:01 -0400 Subject: [PATCH] fix: correct syntax errors in test_llm_triage.py - Wrap multi-line `with` statement in parentheses (was missing backslash continuations, causing SyntaxError on collection) - Fix broken string literal on lines 67-68 by using \n escape instead of a raw newline inside a single-quoted string Fixes #1329 --- tests/scripts/test_llm_triage.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/scripts/test_llm_triage.py b/tests/scripts/test_llm_triage.py index 621189c9..37e57f53 100644 --- a/tests/scripts/test_llm_triage.py +++ b/tests/scripts/test_llm_triage.py @@ -56,16 +56,17 @@ def test_run_triage(mock_gitea_client, mock_llm_client, mock_files): } } - with patch("scripts.llm_triage.PROMPT_PATH", mock_files / "scripts/deep_triage_prompt.md"), - patch("scripts.llm_triage.QUEUE_PATH", mock_files / ".loop/queue.json"), - patch("scripts.llm_triage.SUMMARY_PATH", mock_files / ".loop/retro/summary.json"), - patch("scripts.llm_triage.RETRO_PATH", mock_files / ".loop/retro/deep-triage.jsonl"): + with ( + patch("scripts.llm_triage.PROMPT_PATH", mock_files / "scripts/deep_triage_prompt.md"), + patch("scripts.llm_triage.QUEUE_PATH", mock_files / ".loop/queue.json"), + patch("scripts.llm_triage.SUMMARY_PATH", mock_files / ".loop/retro/summary.json"), + patch("scripts.llm_triage.RETRO_PATH", mock_files / ".loop/retro/deep-triage.jsonl"), + ): run_triage() # Check that the queue and retro files were written assert (mock_files / ".loop/queue.json").read_text() == '[{"issue": 1}]' - assert (mock_files / ".loop/retro/deep-triage.jsonl").read_text() == '{"issues_closed": [2], "issues_created": [{"title": "New Issue", "body": "This is a new issue."}]} -' + assert (mock_files / ".loop/retro/deep-triage.jsonl").read_text() == '{"issues_closed": [2], "issues_created": [{"title": "New Issue", "body": "This is a new issue."}]}\n' # Check that the Gitea client was called correctly mock_gitea_client.return_value.close_issue.assert_called_once_with(2) -- 2.43.0