Skip to content

Commit 9f6b55d

Browse files
committed
tests/process: Another attempt to fix process tests under travis
1 parent 6a9226c commit 9f6b55d

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

tests/test_process.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,13 @@ async def test():
2020
proc = await asyncio.create_subprocess_shell(
2121
cmd,
2222
env=env,
23-
stdin=subprocess.PIPE,
2423
stdout=subprocess.PIPE,
2524
stderr=subprocess.PIPE,
2625
loop=self.loop)
2726

28-
exitcode = await proc.wait()
29-
self.assertEqual(exitcode, 0)
30-
31-
out = await proc.stdout.read()
27+
out, _ = await proc.communicate()
3228
self.assertEqual(out, b'spam\n')
29+
self.assertEqual(proc.returncode, 0)
3330

3431
self.loop.run_until_complete(test())
3532

@@ -42,16 +39,13 @@ async def test():
4239
cmd,
4340
cwd=cwd,
4441
env=env,
45-
stdin=subprocess.PIPE,
4642
stdout=subprocess.PIPE,
4743
stderr=subprocess.PIPE,
4844
loop=self.loop)
4945

50-
exitcode = await proc.wait()
51-
self.assertEqual(exitcode, 0)
52-
53-
out = await proc.stdout.read()
46+
out, _ = await proc.communicate()
5447
self.assertEqual(out, b'/\n')
48+
self.assertEqual(proc.returncode, 0)
5549

5650
self.loop.run_until_complete(test())
5751

0 commit comments

Comments
 (0)