Skip to content

Commit 5cee35e

Browse files
test: tighten review test assertions
1 parent e992d51 commit 5cee35e

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

tests/test_error_codes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,4 +149,4 @@ def test_cli_ambiguous_session_prefix_surfaces_code(tmp_path) -> None:
149149
proc = _run_cli(["stats", "--base-dir", str(base), "--session", "session_aaa"])
150150
assert proc.returncode == 1
151151
assert "SESSION_AMBIGUOUS_PREFIX" in proc.stderr
152-
assert "SESSION_NOT_FOUND" not in proc.stderr.split("SESSION_AMBIGUOUS_PREFIX")[0]
152+
assert "SESSION_NOT_FOUND" not in proc.stderr

tests/test_tool_dispatch_sync.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ def _parse_frontend_tool_result_renderers(path: Path) -> frozenset[str]:
7878

7979

8080
def _parse_top_level_function_body(text: str, func_name: str) -> str:
81-
"""Slice a module-level ``def`` through the next top-level ``def`` (if any)."""
81+
"""Slice a module-level ``def`` through the next top-level ``def`` or EOF."""
8282
match = re.search(
83-
rf"^def {re.escape(func_name)}\(.*?(?=^\ndef )",
83+
rf"^def {re.escape(func_name)}\(.*?(?=^\ndef |\Z)",
8484
text,
8585
re.DOTALL | re.MULTILINE,
8686
)

0 commit comments

Comments
 (0)