From 73cbc5e731c9e75241e330a6a3370e0c8caa4bfd Mon Sep 17 00:00:00 2001 From: Theophilus Chinomona Date: Wed, 5 Aug 2026 10:50:00 +0200 Subject: [PATCH] test(file_operations): pin early surrogate rejection over the backstop (#79178) --- tests/tools/test_file_write_surrogate_roundtrip.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/tools/test_file_write_surrogate_roundtrip.py b/tests/tools/test_file_write_surrogate_roundtrip.py index 03d6e014b3ab0..d90430743293a 100644 --- a/tests/tools/test_file_write_surrogate_roundtrip.py +++ b/tests/tools/test_file_write_surrogate_roundtrip.py @@ -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):