MCPcopy Index your code
hub / github.com/RustPython/RustPython / captured_stdout

Function captured_stdout

Lib/test/test_xmlrpc.py:1426–1435  ·  view source on GitHub ↗

A variation on support.captured_stdout() which gives a text stream having a `buffer` attribute.

(encoding='utf-8')

Source from the content-addressed store, hash-verified

1424
1425@contextlib.contextmanager
1426def captured_stdout(encoding='utf-8'):
1427 """A variation on support.captured_stdout() which gives a text stream
1428 having a `buffer` attribute.
1429 """
1430 orig_stdout = sys.stdout
1431 sys.stdout = io.TextIOWrapper(io.BytesIO(), encoding=encoding)
1432 try:
1433 yield sys.stdout
1434 finally:
1435 sys.stdout = orig_stdout
1436
1437
1438class CGIHandlerTestCase(unittest.TestCase):

Callers 2

test_cgi_getMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected