def test_iterator_raise(self): raise_at = 2 x = radist.pmap(int, self.err_iterator(raise_at)) t = get_exec_time(self.failUnlessRaises, MyException, list, x) assert t <= raise_at * 0.55, "time was %.2f" % t tc = threading.activeCount() assert tc == 1, "there are %d threads" % tc
def test_func_raise(self): raise_at = 2 x = radist.pmap(map_raise_at(raise_at), xrange(20)) t = get_exec_time(self.failUnlessRaises, MyException, list, x) assert t <= raise_at * 1.1, "time was %f" % t tc = threading.activeCount() # XXX it's bad, but i can't do it better # anyway it's not a huge problem with bad thread, i hope... assert tc in [1, 2], "there are %d threads" % tc
def test_simple(self): x = radist.pmap(int, xrange(30)) assert list(x) == range(30)
def test_double(self): x = radist.pmap(max, xrange(30), range(3), range(20)) assert list(x) == range(30)
def test_none(self): x = radist.pmap(None, xrange(30)) assert list(x) == range(30)