raise a ValueError instead of an AssertionError when pool is an invalid state

This commit is contained in:
Benjamin Peterson 2012-09-25 12:45:42 -04:00
parent 3331a20464
commit 3095f4724e
2 changed files with 10 additions and 8 deletions

View file

@ -1727,7 +1727,8 @@ class _TestPool(BaseTestCase):
with multiprocessing.Pool(2) as p:
r = p.map_async(sqr, L)
self.assertEqual(r.get(), expected)
self.assertRaises(AssertionError, p.map_async, sqr, L)
print(p._state)
self.assertRaises(ValueError, p.map_async, sqr, L)
def raising():
raise KeyError("key")