summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorYury Selivanov <yury@magic.io>2018-05-30 00:57:50 (GMT)
committerGitHub <noreply@github.com>2018-05-30 00:57:50 (GMT)
commitad74d50517c069359578014bb32e660828d68332 (patch)
tree12715e7f1c89c0e1a2e1f87ec4c2817bf3de366d /Lib
parent99279ad823a758288e4e41962abfc4dad8943ce8 (diff)
downloadcpython-ad74d50517c069359578014bb32e660828d68332.zip
cpython-ad74d50517c069359578014bb32e660828d68332.tar.gz
cpython-ad74d50517c069359578014bb32e660828d68332.tar.bz2
A better fix for asyncio test_stdin_broken_pipe (#7221)
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_asyncio/test_subprocess.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/test/test_asyncio/test_subprocess.py b/Lib/test/test_asyncio/test_subprocess.py
index 235813a..0158337 100644
--- a/Lib/test/test_asyncio/test_subprocess.py
+++ b/Lib/test/test_asyncio/test_subprocess.py
@@ -218,8 +218,10 @@ class SubprocessMixin:
# the program ends before the stdin can be feeded
create = asyncio.create_subprocess_exec(
- sys.executable, '-c', 'pass',
+ sys.executable,
+ '-c', 'print("hello", flush=True)',
stdin=subprocess.PIPE,
+ stdout=subprocess.PIPE,
loop=self.loop)
proc = self.loop.run_until_complete(create)
return (proc, large_data)
@@ -228,7 +230,7 @@ class SubprocessMixin:
proc, large_data = self.prepare_broken_pipe_test()
async def write_stdin(proc, data):
- await asyncio.sleep(0.5, loop=self.loop)
+ await proc.stdout.readline()
proc.stdin.write(data)
await proc.stdin.drain()