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

Method test_context

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

Source from the content-addressed store, hash-verified

3153
3154 @warnings_helper.ignore_fork_in_thread_deprecation_warnings()
3155 def test_context(self):
3156 if self.TYPE == 'processes':
3157 L = list(range(10))
3158 expected = [sqr(i) for i in L]
3159 with self.Pool(2) as p:
3160 r = p.map_async(sqr, L)
3161 self.assertEqual(r.get(), expected)
3162 p.join()
3163 self.assertRaises(ValueError, p.map_async, sqr, L)
3164
3165 @classmethod
3166 def _test_traceback(cls):

Callers

nothing calls this directly

Calls 8

listClass · 0.85
sqrFunction · 0.85
map_asyncMethod · 0.80
PoolMethod · 0.45
assertEqualMethod · 0.45
getMethod · 0.45
joinMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected