fix: configure harness console as utf-8
This commit is contained in:
@@ -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"]
|
||||
|
||||
Reference in New Issue
Block a user