MCPcopy Index your code
hub / github.com/python/cpython / setUpModule

Function setUpModule

Lib/test/_test_multiprocessing.py:7387–7407  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7385 old_start_method = [None]
7386
7387 def setUpModule():
7388 multiprocessing.set_forkserver_preload(PRELOAD)
7389 multiprocessing.process._cleanup()
7390 dangling[0] = multiprocessing.process._dangling.copy()
7391 dangling[1] = threading._dangling.copy()
7392 old_start_method[0] = multiprocessing.get_start_method(allow_none=True)
7393 try:
7394 multiprocessing.set_start_method(start_method, force=True)
7395 except ValueError:
7396 raise unittest.SkipTest(start_method +
7397 ' start method not supported')
7398
7399 if sys.platform.startswith("linux"):
7400 try:
7401 lock = multiprocessing.RLock()
7402 except OSError:
7403 raise unittest.SkipTest("OSError raises on RLock creation, "
7404 "see issue 3111!")
7405 check_enough_semaphores()
7406 util.get_temp_dir() # creates temp directory
7407 multiprocessing.get_logger().setLevel(LOG_LEVEL)
7408
7409 def tearDownModule():
7410 need_sleep = False

Callers

nothing calls this directly

Calls 10

check_enough_semaphoresFunction · 0.85
RLockMethod · 0.80
get_loggerMethod · 0.80
_cleanupMethod · 0.45
copyMethod · 0.45
get_start_methodMethod · 0.45
set_start_methodMethod · 0.45
startswithMethod · 0.45
setLevelMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…