Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 56e8c29 + 0dee8ad commit 38d773bCopy full SHA for 38d773b
1 file changed
Lib/test/test_asyncio/test_subprocess.py
@@ -141,10 +141,15 @@ def prepare_broken_pipe_test(self):
141
def test_stdin_broken_pipe(self):
142
proc, large_data = self.prepare_broken_pipe_test()
143
144
+ @asyncio.coroutine
145
+ def write_stdin(proc, data):
146
+ proc.stdin.write(data)
147
+ yield from proc.stdin.drain()
148
+
149
+ coro = write_stdin(proc, large_data)
150
# drain() must raise BrokenPipeError or ConnectionResetError
- proc.stdin.write(large_data)
151
self.assertRaises((BrokenPipeError, ConnectionResetError),
- self.loop.run_until_complete, proc.stdin.drain())
152
+ self.loop.run_until_complete, coro)
153
self.loop.run_until_complete(proc.wait())
154
155
def test_communicate_ignore_broken_pipe(self):
0 commit comments