Commit 2a4a8aeb authored by Denis Bilenko's avatar Denis Bilenko

test__pool.py: add test__empty

parent c7484aaf
......@@ -291,6 +291,15 @@ class TestPool(greentest.TestCase):
it = self.pool.imap_unordered(sqr_random_sleep, range(10))
self.assertEqual(sorted(it), list(map(sqr, range(10))))
def test_empty(self):
it = self.pool.imap_unordered(sqr, [])
self.assertEqual(list(it), [])
it = self.pool.imap(sqr, [])
self.assertEqual(list(it), [])
self.assertEqual(self.pool.map(sqr, []), [])
def test_terminate(self):
result = self.pool.map_async(gevent.sleep, [0.1] * ((self.size or 10) * 2))
gevent.sleep(0.1)
......
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