Commit b9da7631 authored by Denis Bilenko's avatar Denis Bilenko

test__pool.py: add another test case for imap_unordered

parent 67ae3668
......@@ -251,6 +251,19 @@ class TestPool(greentest.TestCase):
kill()
assert kill.elapsed < 0.5, kill.elapsed
def sleep(self, x):
gevent.sleep(float(x) / 10.)
return str(x)
def test_imap_unordered_sleep(self):
# testing that imap_unordered returns items in competion order
result = list(self.pool.imap_unordered(self.sleep, [10, 1, 2]))
if self.pool.size == 1:
expected = ['10', '1', '2']
else:
expected = ['1', '2', '10']
self.assertEqual(result, expected)
class TestPool2(TestPool):
size = 2
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment