From 16ddad4fe63233848aeba5206138ba096ae819d3 2013-05-05 22:30:03 From: MinRK Date: 2013-05-05 22:30:03 Subject: [PATCH] test view.map on a generator --- diff --git a/IPython/parallel/tests/test_lbview.py b/IPython/parallel/tests/test_lbview.py index 18040d9..dd8f57a 100644 --- a/IPython/parallel/tests/test_lbview.py +++ b/IPython/parallel/tests/test_lbview.py @@ -58,7 +58,15 @@ class TestLoadBalancedView(ClusterTestCase): data = range(16) r = self.view.map_sync(f, data) self.assertEqual(r, map(f, data)) - + + def test_map_generator(self): + def f(x): + return x**2 + + data = range(16) + r = self.view.map_sync(f, iter(data)) + self.assertEqual(r, map(f, iter(data))) + def test_map_short_first(self): def f(x,y): if y is None: