File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
Lib/test/test_concurrent_futures Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change 4
4
import multiprocessing .util
5
5
import os
6
6
import threading
7
- import warnings
8
7
import unittest
9
8
from concurrent import futures
10
9
from test import support
@@ -68,15 +67,15 @@ def submit(pool):
68
67
workers .submit (tuple )
69
68
70
69
@support .requires_fork ()
71
- @unittest .skipUnless (hasattr (os , " register_at_fork" ), " need os.register_at_fork" )
72
- @support .requires_resource (" cpu" )
70
+ @unittest .skipUnless (hasattr (os , ' register_at_fork' ), ' need os.register_at_fork' )
71
+ @support .requires_resource (' cpu' )
73
72
def test_process_fork_from_a_threadpool (self ):
74
73
# bpo-43944: clear concurrent.futures.thread._threads_queues after fork,
75
74
# otherwise child process will try to join parent thread
76
75
def fork_process_and_return_exitcode ():
77
76
# Ignore the warning about fork with threads.
78
- with warnings . catch_warnings ( category = DeprecationWarning , action = "ignore " ):
79
- p = mp .get_context (" fork" ).Process (target = lambda : 1 )
77
+ with self . assertWarnsRegex ( DeprecationWarning , msg = "use of fork() may lead to deadlocks in child " ):
78
+ p = mp .get_context (' fork' ).Process (target = lambda : 1 )
80
79
p .start ()
81
80
p .join ()
82
81
return p .exitcode
You can’t perform that action at this time.
0 commit comments