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

Method test_capturing_readouterr

testing/test_capture.py:1170–1179  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1168 assert err == "hello error\n"
1169
1170 def test_capturing_readouterr(self) -> None:
1171 with self.getcapture() as cap:
1172 print("hello world")
1173 sys.stderr.write("hello error\n")
1174 out, err = cap.readouterr()
1175 assert out == "hello world\n"
1176 assert err == "hello error\n"
1177 sys.stderr.write("error2")
1178 out, err = cap.readouterr()
1179 assert err == "error2"
1180
1181 def test_capture_results_accessible_by_attribute(self) -> None:
1182 with self.getcapture() as cap:

Callers

nothing calls this directly

Calls 3

getcaptureMethod · 0.95
writeMethod · 0.45
readouterrMethod · 0.45

Tested by

no test coverage detected