test(file_operations): pin early surrogate rejection over the backstop (#79178)

This commit is contained in:
Theophilus Chinomona 2026-08-05 10:50:00 +02:00 committed by Teknium
parent d6eda8d9c5
commit 73cbc5e731
1 changed files with 4 additions and 0 deletions

View File

@ -119,6 +119,10 @@ class TestWriteFileSurrogates:
assert res.error and "surrogate" in res.error
assert "NOT created or modified" in res.error
assert "timed out" not in res.error
# Pins the EARLY rejection (char repr in the message) rather than the
# post-BOM backstop (whose message contains the codec traceback) —
# the early rejection is what guarantees no child ever spawns.
assert "codec can't encode" not in res.error
assert not p.exists()
def test_rejected_write_leaves_existing_target_unchanged(self, ops, tmp_path):