MCPcopy Index your code
hub / github.com/bpython/bpython / captured_output

Function captured_output

bpython/test/test_curtsies_repl.py:224–231  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

222# from http://stackoverflow.com/a/17981937/398212 - thanks @rkennedy
223@contextmanager
224def captured_output():
225 new_out, new_err = io.StringIO(), io.StringIO()
226 old_out, old_err = sys.stdout, sys.stderr
227 try:
228 sys.stdout, sys.stderr = new_out, new_err
229 yield sys.stdout, sys.stderr
230 finally:
231 sys.stdout, sys.stderr = old_out, old_err
232
233
234def create_repl(**kwargs):

Callers 3

test_replMethod · 0.85
test_interactiveMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected