summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asyncio/test_subprocess.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_asyncio/test_subprocess.py')
-rw-r--r--Lib/test/test_asyncio/test_subprocess.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/Lib/test/test_asyncio/test_subprocess.py b/Lib/test/test_asyncio/test_subprocess.py
index eba6e2d..eeeca40 100644
--- a/Lib/test/test_asyncio/test_subprocess.py
+++ b/Lib/test/test_asyncio/test_subprocess.py
@@ -151,6 +151,24 @@ class SubprocessMixin:
self.assertEqual(exitcode, 0)
self.assertEqual(stdout, b'some data')
+ def test_communicate_none_input(self):
+ args = PROGRAM_CAT
+
+ async def run():
+ proc = await asyncio.create_subprocess_exec(
+ *args,
+ stdin=subprocess.PIPE,
+ stdout=subprocess.PIPE,
+ )
+ stdout, stderr = await proc.communicate()
+ return proc.returncode, stdout
+
+ task = run()
+ task = asyncio.wait_for(task, support.LONG_TIMEOUT)
+ exitcode, stdout = self.loop.run_until_complete(task)
+ self.assertEqual(exitcode, 0)
+ self.assertEqual(stdout, b'')
+
def test_shell(self):
proc = self.loop.run_until_complete(
asyncio.create_subprocess_shell('exit 7')