diff -r 024827a9db64 Lib/test/test_multiprocessing.py --- a/Lib/test/test_multiprocessing.py Fri Jun 24 20:52:27 2011 +0200 +++ b/Lib/test/test_multiprocessing.py Sat Jun 25 15:12:29 2011 +0200 @@ -1093,16 +1093,24 @@ class _TestPool(BaseTestCase): self.assertEqual(papply(sqr, (), {'x':3}), sqr(x=3)) def test_map(self): pmap = self.pool.map self.assertEqual(pmap(sqr, list(range(10))), list(map(sqr, list(range(10))))) self.assertEqual(pmap(sqr, list(range(100)), chunksize=20), list(map(sqr, list(range(100))))) + # Pass an empty sequence to pool.map issue #12157. + p = multiprocessing.Pool(1) + p.map(sqr, []) + p.close() + # Test if the join will not hang for more than 5s. + with test.support.operation_timeout(5): + p.join() + def test_map_chunksize(self): try: self.pool.map_async(sqr, [], chunksize=1).get(timeout=TIMEOUT1) except multiprocessing.TimeoutError: self.fail("pool.map_async with chunksize stalled on null list") def test_async(self): res = self.pool.apply_async(sqr, (7, TIMEOUT1,))

AltStyle によって変換されたページ (->オリジナル) /