@@ -142,6 +142,7 @@ def _resource_unlink(name, rtype):
142142 'HAVE_BROKEN_SEM_GETVALUE' , False )
143143
144144WIN32 = (sys .platform == "win32" )
145+ ALL_START_METHODS = multiprocessing .get_all_start_methods ()
145146
146147def wait_for_handle (handle , timeout ):
147148 if timeout is not None and timeout < 0.0 :
@@ -239,6 +240,8 @@ class TestInternalDecorators(unittest.TestCase):
239240 """Logic within a test suite that could errantly skip tests? Test it!"""
240241
241242 @support .requires_fork ()
243+ # Cygwin has fork() but lacks start method 'fork'
244+ @unittest .skipUnless ('fork' in ALL_START_METHODS , 'need fork start method' )
242245 def test_only_run_in_spawn_testsuite (self ):
243246 if multiprocessing .get_start_method () != "spawn" :
244247 raise unittest .SkipTest ("only run in test_multiprocessing_spawn." )
@@ -6104,7 +6107,7 @@ def test_set_get(self):
61046107 def test_get_all_start_methods (self ):
61056108 methods = multiprocessing .get_all_start_methods ()
61066109 self .assertIn ('spawn' , methods )
6107- if sys .platform == 'win32' :
6110+ if sys .platform in ( 'win32' , 'cygwin' ) :
61086111 self .assertEqual (methods , ['spawn' ])
61096112 elif sys .platform == 'darwin' :
61106113 self .assertEqual (methods [0 ], 'spawn' ) # The default is first.
@@ -6138,7 +6141,7 @@ def test_preload_resources(self):
61386141 self .fail ("failed spawning forkserver or grandchild" )
61396142
61406143 @warnings_helper .ignore_fork_in_thread_deprecation_warnings ()
6141- @unittest .skipIf (sys .platform == "win32" ,
6144+ @unittest .skipIf (sys .platform in ( "win32" , "cygwin" ) ,
61426145 "Only Spawn on windows so no risk of mixing" )
61436146 @only_run_in_spawn_testsuite ("avoids redundant testing." )
61446147 def test_mixed_startmethod (self ):
0 commit comments