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

Method test_imap

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

Source from the content-addressed store, hash-verified

3022 p.join()
3023
3024 def test_imap(self):
3025 it = self.pool.imap(sqr, list(range(10)))
3026 self.assertEqual(list(it), list(map(sqr, list(range(10)))))
3027
3028 it = self.pool.imap(sqr, list(range(10)))
3029 for i in range(10):
3030 self.assertEqual(next(it), i*i)
3031 self.assertRaises(StopIteration, it.__next__)
3032
3033 it = self.pool.imap(sqr, list(range(1000)), chunksize=100)
3034 for i in range(1000):
3035 self.assertEqual(next(it), i*i)
3036 self.assertRaises(StopIteration, it.__next__)
3037
3038 def test_imap_handle_iterable_exception(self):
3039 if self.TYPE == 'manager':

Callers

nothing calls this directly

Calls 4

listClass · 0.85
imapMethod · 0.80
assertEqualMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected