summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asyncio
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-07-21 14:23:33 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2014-07-21 14:23:33 (GMT)
commit0dee8ad579c57ee533251004f66f1f4c6fee1691 (patch)
tree349eafcd632a0cb0eb7e871f33219d1ddf0d8bbc /Lib/test/test_asyncio
parent854e76effaa272feed874c0e828ee679a3949dc2 (diff)
downloadcpython-0dee8ad579c57ee533251004f66f1f4c6fee1691.zip
cpython-0dee8ad579c57ee533251004f66f1f4c6fee1691.tar.gz
cpython-0dee8ad579c57ee533251004f66f1f4c6fee1691.tar.bz2
asyncio: Fix test_stdin_broken_pipe(), drain() is not a coroutine
Diffstat (limited to 'Lib/test/test_asyncio')
-rw-r--r--Lib/test/test_asyncio/test_subprocess.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/Lib/test/test_asyncio/test_subprocess.py b/Lib/test/test_asyncio/test_subprocess.py
index 5425d9b..a4e9df2 100644
--- a/Lib/test/test_asyncio/test_subprocess.py
+++ b/Lib/test/test_asyncio/test_subprocess.py
@@ -141,10 +141,15 @@ class SubprocessMixin:
def test_stdin_broken_pipe(self):
proc, large_data = self.prepare_broken_pipe_test()
+ @asyncio.coroutine
+ def write_stdin(proc, data):
+ proc.stdin.write(data)
+ yield from proc.stdin.drain()
+
+ coro = write_stdin(proc, large_data)
# drain() must raise BrokenPipeError or ConnectionResetError
- proc.stdin.write(large_data)
self.assertRaises((BrokenPipeError, ConnectionResetError),
- self.loop.run_until_complete, proc.stdin.drain())
+ self.loop.run_until_complete, coro)
self.loop.run_until_complete(proc.wait())
def test_communicate_ignore_broken_pipe(self):