Skip to content

Commit 4492574

Browse files
committed
Better explain test logic with comments.
1 parent ea574cc commit 4492574

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Lib/test/_test_multiprocessing.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5567,11 +5567,14 @@ def test_get_all_start_methods(self):
55675567
# POSIX
55685568
self.assertIn('fork', methods)
55695569
if other_methods := set(methods) - {'fork', 'spawn'}:
5570+
# If there are more than those two, forkserver must be one.
55705571
self.assertEqual({'forkserver'}, other_methods)
5571-
# >=3.14 Defaults to forkserver if the platform supports it.
5572+
# The default is the first method in the list.
55725573
self.assertIn(methods[0], {'forkserver', 'spawn'},
55735574
msg='3.14+ default must not be fork')
55745575
if methods[0] == 'spawn':
5576+
# Confirm that the current default selection logic prefers
5577+
# forkserver vs spawn when available.
55755578
self.assertNotIn('forkserver', methods)
55765579

55775580
def test_preload_resources(self):

0 commit comments

Comments
 (0)