Skip to content

Commit 5172eb5

Browse files
committed
fix: use mock-based write failure test for cross-platform CI
1 parent 72d3da5 commit 5172eb5

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

tests/test_runner.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -484,8 +484,9 @@ def test_result_truncated_to_2000(self, tmp_path):
484484
assert len(entries[0]["result_preview"]) == 2000
485485

486486
def test_survives_write_failure(self):
487-
"""write_auto_save to an impossible path does not raise."""
488-
write_auto_save("/dev/null/impossible", turn=1, tool_name="t", result="r")
487+
"""write_auto_save suppresses write errors without crashing."""
488+
with patch("builtins.open", side_effect=OSError("disk full")):
489+
write_auto_save("/tmp/any", turn=1, tool_name="t", result="r")
489490

490491
def test_read_skips_corrupt_trailing_line(self, tmp_path):
491492
"""read_tool_log skips truncated/corrupt lines without discarding valid ones."""

0 commit comments

Comments
 (0)