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

Method test_context

Lib/test/_test_multiprocessing.py:6028–6038  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

6026
6027 @warnings_helper.ignore_fork_in_thread_deprecation_warnings()
6028 def test_context(self):
6029 for method in ('fork', 'spawn', 'forkserver'):
6030 try:
6031 ctx = multiprocessing.get_context(method)
6032 except ValueError:
6033 continue
6034 self.assertEqual(ctx.get_start_method(), method)
6035 self.assertIs(ctx.get_context(), ctx)
6036 self.assertRaises(ValueError, ctx.set_start_method, 'spawn')
6037 self.assertRaises(ValueError, ctx.set_start_method, None)
6038 self.check_context(ctx)
6039
6040 @staticmethod
6041 def _dummy_func():

Callers

nothing calls this directly

Calls 6

check_contextMethod · 0.95
get_contextMethod · 0.45
assertEqualMethod · 0.45
get_start_methodMethod · 0.45
assertIsMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected