diff options
author | Victor Stinner <vstinner@python.org> | 2020-03-31 19:46:40 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-31 19:46:40 (GMT) |
commit | 27c6231f5827fe17c6cb6f097391931f30b511ec (patch) | |
tree | b0f36e377cd2f3a0c7f2b9c08e26eaa51047fdb5 /Lib/test/test_wait4.py | |
parent | 278c1e159c970da6cd6683d18c6211f5118674cc (diff) | |
download | cpython-27c6231f5827fe17c6cb6f097391931f30b511ec.zip cpython-27c6231f5827fe17c6cb6f097391931f30b511ec.tar.gz cpython-27c6231f5827fe17c6cb6f097391931f30b511ec.tar.bz2 |
bpo-40094: Enhance fork and wait tests (GH-19259)
* test_fork1: remove duplicated wait_impl() method: reuse
fork_wait.py implementation instead.
* Use exit code different than 0 to ensure that we executed the
expected code path.
Diffstat (limited to 'Lib/test/test_wait4.py')
-rw-r--r-- | Lib/test/test_wait4.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/test/test_wait4.py b/Lib/test/test_wait4.py index a186072..6c7ebcb 100644 --- a/Lib/test/test_wait4.py +++ b/Lib/test/test_wait4.py @@ -14,7 +14,7 @@ support.get_attribute(os, 'wait4') class Wait4Test(ForkWait): - def wait_impl(self, cpid): + def wait_impl(self, cpid, *, exitcode): option = os.WNOHANG if sys.platform.startswith('aix'): # Issue #11185: wait4 is broken on AIX and will always return 0 @@ -29,7 +29,8 @@ class Wait4Test(ForkWait): break time.sleep(0.1) self.assertEqual(spid, cpid) - self.assertEqual(status, 0, "cause = %d, exit = %d" % (status&0xff, status>>8)) + self.assertEqual(status, exitcode << 8, + "cause = %d, exit = %d" % (status&0xff, status>>8)) self.assertTrue(rusage) def tearDownModule(): |