]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-154272: Skip more forkserver tests if the start method is unavailable (GH-154499) main
authorSerhiy Storchaka <storchaka@gmail.com>
Wed, 22 Jul 2026 18:25:37 +0000 (21:25 +0300)
committerGitHub <noreply@github.com>
Wed, 22 Jul 2026 18:25:37 +0000 (18:25 +0000)
Two tests were still not skipped: they were only guarded against Cygwin
and Windows.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Lib/test/test_concurrent_futures/test_init.py
Lib/test/test_profiling/test_tracing_profiler.py

index ca612db17ce8021f4afa3f617e5e01e73e60eaa5..c9fedc7213256c7155f367139af7b04a17a4ee80 100644 (file)
@@ -1,5 +1,6 @@
 import contextlib
 import logging
+import multiprocessing
 import queue
 import time
 import unittest
@@ -147,8 +148,8 @@ class FailingInitializerResourcesTest(unittest.TestCase):
         self._test(ProcessPoolSpawnFailingInitializerTest)
 
     @support.skip_if_sanitizer("TSAN doesn't support threads after fork", thread=True)
-    @unittest.skipIf(sys.platform == "cygwin",
-                     "Forkserver is not available on Cygwin")
+    @unittest.skipUnless("forkserver" in multiprocessing.get_all_start_methods(),
+                         "forkserver start method is not available")
     def test_forkserver(self):
         self._test(ProcessPoolForkserverFailingInitializerTest)
 
index 8a7070142b60eec5dd04d0106bb72377f07a40a6..6a4d968f12ef1565d7e2463c1e7a6c1cbd6f97ca 100644 (file)
@@ -1,4 +1,5 @@
 """Test suite for the cProfile module."""
+import multiprocessing
 import sys
 import unittest
 
@@ -220,8 +221,8 @@ class TestCommandLine(unittest.TestCase):
         # 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')