mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Merge.
This commit is contained in:
commit
33aaa73cad
2 changed files with 19 additions and 5 deletions
|
@ -1698,6 +1698,16 @@ class _TestPool(BaseTestCase):
|
|||
self.assertEqual(2, len(call_args))
|
||||
self.assertIsInstance(call_args[1], ValueError)
|
||||
|
||||
def test_map_unplicklable(self):
|
||||
# Issue #19425 -- failure to pickle should not cause a hang
|
||||
if self.TYPE == 'threads':
|
||||
return
|
||||
class A(object):
|
||||
def __reduce__(self):
|
||||
raise RuntimeError('cannot pickle')
|
||||
with self.assertRaises(RuntimeError):
|
||||
self.pool.map(sqr, [A()]*10)
|
||||
|
||||
def test_map_chunksize(self):
|
||||
try:
|
||||
self.pool.map_async(sqr, [], chunksize=1).get(timeout=TIMEOUT1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue