Message190152
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' |
|
Date |
User |
Action |
Args |
2013-05-27 18:51:11 | dmi.baranov | set | recipients:
+ dmi.baranov, fdrake, docs@python, serhiy.storchaka |
2013-05-27 18:51:11 | dmi.baranov | set | messageid: <1369680671.3.0.744855248142.issue17987@psf.upfronthosting.co.za> |
2013-05-27 18:51:11 | dmi.baranov | link | issue17987 messages |
2013-05-27 18:51:11 | dmi.baranov | create | |
|