diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2014-02-03 22:08:14 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2014-02-03 22:08:14 (GMT) |
commit | b79eb0502c5a01d4ebf793d689f6cc5fa35a1ed5 (patch) | |
tree | 4e8aaa069699ce2854c48a4682418e499faa524f /Lib/test | |
parent | cb306d1b592d03f56630a3551b89b97ab34492e9 (diff) | |
download | cpython-b79eb0502c5a01d4ebf793d689f6cc5fa35a1ed5.zip cpython-b79eb0502c5a01d4ebf793d689f6cc5fa35a1ed5.tar.gz cpython-b79eb0502c5a01d4ebf793d689f6cc5fa35a1ed5.tar.bz2 |
asyncio.subprocess: Replace Process.get_subprocess() method with a
Process.subprocess read-only property
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_asyncio/test_subprocess.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/Lib/test/test_asyncio/test_subprocess.py b/Lib/test/test_asyncio/test_subprocess.py index 4f38cc7..785156c 100644 --- a/Lib/test/test_asyncio/test_subprocess.py +++ b/Lib/test/test_asyncio/test_subprocess.py @@ -119,7 +119,7 @@ class SubprocessMixin: returncode = self.loop.run_until_complete(proc.wait()) self.assertEqual(-signal.SIGHUP, returncode) - def test_get_subprocess(self): + def test_subprocess(self): args = PROGRAM_EXIT_FAST @asyncio.coroutine @@ -127,14 +127,14 @@ class SubprocessMixin: proc = yield from asyncio.create_subprocess_exec(*args, loop=self.loop) yield from proc.wait() - - popen = proc.get_subprocess() - popen.wait() - return (proc, popen) - - proc, popen = self.loop.run_until_complete(run()) - self.assertEqual(popen.returncode, proc.returncode) - self.assertEqual(popen.pid, proc.pid) + # need to poll subprocess.Popen, otherwise the returncode + # attribute is not set + proc.subprocess.wait() + return proc + + proc = self.loop.run_until_complete(run()) + self.assertEqual(proc.subprocess.returncode, proc.returncode) + self.assertEqual(proc.subprocess.pid, proc.pid) def test_broken_pipe(self): large_data = b'x' * support.PIPE_MAX_SIZE |