Commit b3eebab9 authored by Jason Madden's avatar Jason Madden

Clean up a test func.

parent 56d26492
...@@ -184,16 +184,13 @@ class PoolBasicTests(greentest.TestCase): ...@@ -184,16 +184,13 @@ class PoolBasicTests(greentest.TestCase):
self.assertEqual(p.free_count(), 1) self.assertEqual(p.free_count(), 1)
self.assertEqual(len(p), 0) self.assertEqual(len(p), 0)
p.add(first) p.add(first)
timeout = gevent.Timeout(0.1) self.assertEqual(p.free_count(), 0)
timeout.start() self.assertEqual(len(p), 1)
try:
with self.assertRaises(gevent.Timeout):
with gevent.Timeout(0.1):
p.add(second) p.add(second)
except gevent.Timeout:
pass
else:
raise AssertionError('Expected timeout')
finally:
timeout.close()
self.assertEqual(p.free_count(), 0) self.assertEqual(p.free_count(), 0)
self.assertEqual(len(p), 1) self.assertEqual(len(p), 1)
finally: finally:
......
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