MCPcopy
hub / github.com/pytest-dev/pytest / test_write_bytes_to_buffer

Method test_write_bytes_to_buffer

testing/test_capture.py:912–918  ·  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

910 f.write(b"hello") # type: ignore[arg-type]
911
912 def test_write_bytes_to_buffer(self) -> None:
913 """In python3, stdout / stderr are text io wrappers (exposing a buffer
914 property of the underlying bytestream). See issue #1407
915 """
916 f = capture.CaptureIO()
917 f.buffer.write(b"foo\r\n")
918 assert f.getvalue() == "foo\r\n"
919
920
921class TestTeeCaptureIO(TestCaptureIO):

Callers

nothing calls this directly

Calls 2

getvalueMethod · 0.95
writeMethod · 0.45

Tested by

no test coverage detected