with self.Pool(2) as p:
r = p.map_async(sqr, L)
self.assertEqual(r.get(), expected)
+ p.join()
self.assertRaises(ValueError, p.map_async, sqr, L)
@classmethod
exc = e
else:
self.fail('expected RuntimeError')
+ p.join()
self.assertIs(type(exc), RuntimeError)
self.assertEqual(exc.args, (123,))
cause = exc.__cause__
self.fail('expected SayWhenError')
self.assertIs(type(exc), SayWhenError)
self.assertIs(exc.__cause__, None)
+ p.join()
@classmethod
def _test_wrapped_exception(cls):