MCPcopy Create free account
hub / github.com/pytest-dev/pytest / test_write_bytes_to_buffer

Method test_write_bytes_to_buffer

testing/test_capture.py:861–867  ·  view source on GitHub ↗

In python3, stdout / stderr are text io wrappers (exposing a buffer property of the underlying bytestream). See issue #1407

(self)

Source from the content-addressed store, hash-verified

859 pytest.raises(TypeError, f.write, b"hello")
860
861 def test_write_bytes_to_buffer(self) -> None:
862 """In python3, stdout / stderr are text io wrappers (exposing a buffer
863 property of the underlying bytestream). See issue #1407
864 """
865 f = capture.CaptureIO()
866 f.buffer.write(b"foo\r\n")
867 assert f.getvalue() == "foo\r\n"
868
869
870class TestTeeCaptureIO(TestCaptureIO):

Callers

nothing calls this directly

Calls 2

getvalueMethod · 0.95
writeMethod · 0.45

Tested by

no test coverage detected