File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -337,18 +337,6 @@ def func():
337337 handle = thread .start_joinable_thread (func , handle = None )
338338 handle .join ()
339339
340- def test_forked_not_started (self ):
341- handle = thread ._ThreadHandle ()
342- pid = os .fork ()
343- if pid == 0 :
344- # child process
345- try :
346- self .assertTrue (handle .is_alive ())
347- self .assertFalse (handle .is_done ())
348- finally :
349- os ._exit (0 )
350- else :
351- support .wait_process (pid , exitcode = 0 )
352340
353341class Barrier :
354342 def __init__ (self , num_threads ):
@@ -451,6 +439,21 @@ def fork_thread(read_fd, write_fd):
451439 self .assertIsNotNone (pid )
452440 support .wait_process (pid , exitcode = 0 )
453441
442+ @support .requires_fork ()
443+ @threading_helper .reap_threads
444+ def test_forked_not_started (self ):
445+ handle = thread ._ThreadHandle ()
446+ pid = os .fork ()
447+ if pid == 0 :
448+ # child process
449+ try :
450+ self .assertTrue (handle .is_alive ())
451+ self .assertFalse (handle .is_done ())
452+ finally :
453+ os ._exit (0 )
454+ else :
455+ support .wait_process (pid , exitcode = 0 )
456+
454457 def tearDown (self ):
455458 try :
456459 os .close (self .read_fd )
You can’t perform that action at this time.
0 commit comments