tests.test_output moduleΒΆ
- tests.test_output.UNENCODABLE_ON_CP1252 = ('β', 'β', 'β', 'β')ΒΆ
Glyphs Click Extra prints that a legacy Windows code page cannot encode: the two status marks, and two characters of a rounded table border.
- class tests.test_output.FakeStream(encoding, *, refuse=False)[source]ΒΆ
Bases:
objectA stand-in for a standard stream, recording what it was reconfigured to.
The real streams of a test run already speak UTF-8, so the legacy path is never taken through them.
- tests.test_output.test_prep_path_reopens_the_process_stdout_as_utf8(monkeypatch, tmp_path)[source]ΒΆ
The stdout of the process itself is opened again on its descriptor, as UTF-8.
Its own
cp1252encoding cannot carry the glyphs. Closing the stream returned leaves that stdout open.- Return type:
- tests.test_output.test_prep_path_returns_a_process_stdout_without_descriptor(monkeypatch)[source]ΒΆ
A stdout of the process with no file descriptor is returned as-is.
- Return type:
- tests.test_output.test_prep_path_stdout_reaches_the_runner_capture(capture)[source]ΒΆ
A command writing to
-prints into the capture of Clickβs test runner.Under
capture="fd",sys.stdout.fileno()returns a copy of the original stdout descriptor, so a stream opened on it writes past the capture.- Return type:
- tests.test_output.test_legacy_stream_is_switched_to_utf8(monkeypatch, encoding)[source]ΒΆ
A stream unable to carry the glyphs is reconfigured to UTF-8.
So is a stream reporting an encoding Python does not know.
- Return type:
- tests.test_output.test_utf8_stream_is_left_alone(monkeypatch, encoding)[source]ΒΆ
A stream already speaking UTF-8 is never reconfigured, whatever its spelling.
- Return type:
- tests.test_output.test_a_refusing_stream_never_raises(monkeypatch)[source]ΒΆ
A stream refusing reconfiguration is left as the platform made it.
- Return type: