https://github.com/python/cpython/commit/6bc3e6ca8b1df7ae21534bc4804dc081465f6faf
commit: 6bc3e6ca8b1df7ae21534bc4804dc081465f6faf
branch: 3.15
author: Serhiy Storchaka <[email protected]>
committer: serhiy-storchaka <[email protected]>
date: 2026-07-23T01:46:41+03:00
summary:

[3.15] gh-154272: Skip more forkserver tests if the start method is unavailable 
(GH-154499) (GH-154505)

Two tests were still not skipped: they were only guarded against Cygwin
and Windows.

(cherry picked from commit a2a846678e54b1b5defdccd451c573679094ff02)

Co-authored-by: Claude Opus 4.8 <[email protected]>

files:
M Lib/test/test_concurrent_futures/test_init.py
M Lib/test/test_profiling/test_tracing_profiler.py

diff --git a/Lib/test/test_concurrent_futures/test_init.py 
b/Lib/test/test_concurrent_futures/test_init.py
index 5ea543bf7489821..c9fedc7213256c7 100644
--- a/Lib/test/test_concurrent_futures/test_init.py
+++ b/Lib/test/test_concurrent_futures/test_init.py
@@ -1,5 +1,6 @@
 import contextlib
 import logging
+import multiprocessing
 import queue
 import time
 import unittest
@@ -147,6 +148,8 @@ def test_spawn(self):
         self._test(ProcessPoolSpawnFailingInitializerTest)
 
     @support.skip_if_sanitizer("TSAN doesn't support threads after fork", 
thread=True)
+    @unittest.skipUnless("forkserver" in 
multiprocessing.get_all_start_methods(),
+                         "forkserver start method is not available")
     def test_forkserver(self):
         self._test(ProcessPoolForkserverFailingInitializerTest)
 
diff --git a/Lib/test/test_profiling/test_tracing_profiler.py 
b/Lib/test/test_profiling/test_tracing_profiler.py
index 8a7070142b60eec..6a4d968f12ef156 100644
--- a/Lib/test/test_profiling/test_tracing_profiler.py
+++ b/Lib/test/test_profiling/test_tracing_profiler.py
@@ -1,4 +1,5 @@
 """Test suite for the cProfile module."""
+import multiprocessing
 import sys
 import unittest
 
@@ -220,8 +221,8 @@ def test_process_spawn_pickle(self):
         # gh-140729: test use Process in cProfile.
         self._test_process_run_pickle('spawn')
 
-    @unittest.skipIf(sys.platform == 'win32',
-                     "No 'forkserver' start method on Windows")
+    @unittest.skipUnless("forkserver" in 
multiprocessing.get_all_start_methods(),
+                         "forkserver start method is not available")
     def test_process_forkserver_pickle(self):
         # gh-140729: test use Process in cProfile.
         self._test_process_run_pickle('forkserver')

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to