Dmi Baranov added the comment:
Yes, I agree that this is not an obvious sample, but:
$ ./python -m test.test_support | grep test_captured_stdin
test_captured_stdin (__main__.TestSupport) ... ok
What's about that?
with captured_stdin() as s:
s.write('hello\n')
s.seek(0)
captured = input()
assert captured == 'hello'
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue17987>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com