MCPcopy Create free account
hub / github.com/pybind/pybind11 / test_err

Function test_err

tests/test_iostream.py:195–211  ·  view source on GitHub ↗
(capfd)

Source from the content-addressed store, hash-verified

193
194
195def test_err(capfd):
196 msg = "Something that should not show up in log"
197 stream = StringIO()
198 with redirect_stderr(stream):
199 m.raw_err(msg)
200 stdout, stderr = capfd.readouterr()
201 assert not stdout
202 assert stderr == msg
203 assert not stream.getvalue()
204
205 stream = StringIO()
206 with redirect_stderr(stream):
207 m.captured_err(msg)
208 stdout, stderr = capfd.readouterr()
209 assert not stdout
210 assert not stderr
211 assert stream.getvalue() == msg
212
213
214def test_multi_captured(capfd):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected