Keep test_write_bytes.py source 7-bit ASCII

Use the \u00e9 escape instead of a literal e-acute. The test still
exercises multi-byte UTF-8 encoding.
pull/70/head
Juliusz Sosinowicz 2026-07-13 17:35:04 +00:00
parent 56e3297edd
commit d55a68d4ab
1 changed files with 4 additions and 3 deletions

View File

@ -78,7 +78,8 @@ def test_write_memoryview_sends_contents(monkeypatch):
def test_write_str_is_utf8_encoded(monkeypatch): def test_write_str_is_utf8_encoded(monkeypatch):
# Backward compatibility: str is UTF-8 encoded (historical t2b() # Backward compatibility: str is UTF-8 encoded (historical t2b()
# behavior), not rejected. # behavior), not rejected. The \u00e9 escape keeps the source 7-bit
# ASCII while still exercising a multi-byte UTF-8 encoding.
sock, lib = _make_socket(monkeypatch) sock, lib = _make_socket(monkeypatch)
sock.write("héllo") sock.write("h\u00e9llo")
assert lib.written == "héllo".encode("utf-8") assert lib.written == "h\u00e9llo".encode("utf-8")