Example #1
0
    def test_map_with_exception(self):
        def func(x):
            raise Exception()

        try:
            list(imap_async_eventlet(func, list(range(40))))
        except Exception:
            pass
        else:
            assert False, 'exception expected'
Example #2
0
    def test_map_with_exception(self):
        def func(x):
            raise Exception()

        try:
            list(imap_async_eventlet(func, range(40)))
        except Exception:
            pass
        else:
            assert False, 'exception expected'
Example #3
0
    def test_map(self):
        def func(x):
            eventlet.sleep(0.05)
            return x
        start = time.time()
        result = list(imap_async_eventlet(func, range(40)))
        stop = time.time()

        duration = stop - start
        assert duration < 0.1

        eq_(len(result), 40)
Example #4
0
    def test_map(self):
        def func(x):
            eventlet.sleep(0.05)
            return x

        start = time.time()
        result = list(imap_async_eventlet(func, list(range(40))))
        stop = time.time()

        duration = stop - start
        assert duration < 0.2, "took %s" % duration

        eq_(len(result), 40)