From 9f6b55dbb4c65e67952535b04438b5d63295c1bb Mon Sep 17 00:00:00 2001 From: Yury Selivanov Date: Thu, 14 Apr 2016 16:04:23 -0400 Subject: [PATCH] tests/process: Another attempt to fix process tests under travis --- tests/test_process.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/tests/test_process.py b/tests/test_process.py index 6101d92..0964e55 100644 --- a/tests/test_process.py +++ b/tests/test_process.py @@ -20,16 +20,13 @@ class _TestProcess: proc = await asyncio.create_subprocess_shell( cmd, env=env, - stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, loop=self.loop) - exitcode = await proc.wait() - self.assertEqual(exitcode, 0) - - out = await proc.stdout.read() + out, _ = await proc.communicate() self.assertEqual(out, b'spam\n') + self.assertEqual(proc.returncode, 0) self.loop.run_until_complete(test()) @@ -42,16 +39,13 @@ class _TestProcess: cmd, cwd=cwd, env=env, - stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, loop=self.loop) - exitcode = await proc.wait() - self.assertEqual(exitcode, 0) - - out = await proc.stdout.read() + out, _ = await proc.communicate() self.assertEqual(out, b'/\n') + self.assertEqual(proc.returncode, 0) self.loop.run_until_complete(test())