fix: configure harness console as utf-8

This commit is contained in:
KOKO\Mimi
2026-08-09 02:14:21 +09:00
parent e17574e706
commit 6482cf65b9
2 changed files with 28 additions and 0 deletions
+19
View File
@@ -59,3 +59,22 @@ def test_feature_commit_message_is_windows_console_safe():
)
message.encode("cp949")
def test_configure_utf8_stdio_reconfigures_both_streams(monkeypatch):
class ReconfigurableStream:
def __init__(self):
self.encodings = []
def reconfigure(self, *, encoding):
self.encodings.append(encoding)
stdout = ReconfigurableStream()
stderr = ReconfigurableStream()
monkeypatch.setattr(execute.sys, "stdout", stdout)
monkeypatch.setattr(execute.sys, "stderr", stderr)
execute._configure_utf8_stdio()
assert stdout.encodings == ["utf-8"]
assert stderr.encodings == ["utf-8"]