Message190199
| Author |
fdrake |
| Recipients |
dmi.baranov, docs@python, eli.bendersky, fdrake, serhiy.storchaka |
| Date |
2013年05月28日.12:25:34 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1369743935.1.0.586954762302.issue17987@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Joining the documentation for captured_stderr and captured_stdout makes
sense, as they can really use a single example, and the usage is
completely parallel.
I'd rather see captured_stdin handled separately, perhaps with some
additional comments in the example, to emphasize the intended usage
pattern:
with support.captured_stdin() as s:
# Prepare simulated input:
s.write('hello\n')
s.seek(0)
# Call test code that consumes from stdin:
captured = input()
self.assertEqual(captured, "hello") |
|