summaryrefslogtreecommitdiffstats
path: root/Lib/test/_test_multiprocessing.py
diff options
context:
space:
mode:
authorChristopher Hunt <chrahunt@gmail.com>2020-02-21 09:33:04 (GMT)
committerGitHub <noreply@github.com>2020-02-21 09:33:04 (GMT)
commitc2ac4cf040ea950bf552d1e77bea613a1a5474fe (patch)
tree00d33e24b2e69458a109f64e66bd1b619bb219f5 /Lib/test/_test_multiprocessing.py
parentbaf29b221682be0f4fde53a05ea3f57c3c79f431 (diff)
downloadcpython-c2ac4cf040ea950bf552d1e77bea613a1a5474fe.zip
cpython-c2ac4cf040ea950bf552d1e77bea613a1a5474fe.tar.gz
cpython-c2ac4cf040ea950bf552d1e77bea613a1a5474fe.tar.bz2
bpo-35727: Use exit code 0 on sys.exit() in multiprocessing.Process. (GH-11538)
Diffstat (limited to 'Lib/test/_test_multiprocessing.py')
-rw-r--r--Lib/test/_test_multiprocessing.py21
1 files changed, 15 insertions, 6 deletions
diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py
index 4e48cd4..73dc75d 100644
--- a/Lib/test/_test_multiprocessing.py
+++ b/Lib/test/_test_multiprocessing.py
@@ -864,12 +864,21 @@ class _TestSubclassingProcess(BaseTestCase):
os.unlink(testfn)
- for reason in (True, False, 8):
- p = self.Process(target=sys.exit, args=(reason,))
- p.daemon = True
- p.start()
- join_process(p)
- self.assertEqual(p.exitcode, reason)
+ cases = [
+ ((True,), 1),
+ ((False,), 0),
+ ((8,), 8),
+ ((None,), 0),
+ ((), 0),
+ ]
+
+ for args, expected in cases:
+ with self.subTest(args=args):
+ p = self.Process(target=sys.exit, args=args)
+ p.daemon = True
+ p.start()
+ join_process(p)
+ self.assertEqual(p.exitcode, expected)
#
#