MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_imap

Method test_imap

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

Source from the content-addressed store, hash-verified

2763 p.join()
2764
2765 def test_imap(self):
2766 it = self.pool.imap(sqr, list(range(10)))
2767 self.assertEqual(list(it), list(map(sqr, list(range(10)))))
2768
2769 it = self.pool.imap(sqr, list(range(10)))
2770 for i in range(10):
2771 self.assertEqual(next(it), i*i)
2772 self.assertRaises(StopIteration, it.__next__)
2773
2774 it = self.pool.imap(sqr, list(range(1000)), chunksize=100)
2775 for i in range(1000):
2776 self.assertEqual(next(it), i*i)
2777 self.assertRaises(StopIteration, it.__next__)
2778
2779 def test_imap_handle_iterable_exception(self):
2780 if self.TYPE == 'manager':

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected