Commit c027f79c authored by Denis Bilenko's avatar Denis Bilenko

test__pool.py: do not leak greenlets out of test case

parent b9da7631
...@@ -286,7 +286,9 @@ class TestJoinSleep(greentest.GenericWaitTestCase): ...@@ -286,7 +286,9 @@ class TestJoinSleep(greentest.GenericWaitTestCase):
def wait(self, timeout): def wait(self, timeout):
p = pool.Pool() p = pool.Pool()
g = p.spawn(gevent.sleep, 10) g = p.spawn(gevent.sleep, 10)
try:
p.join(timeout=timeout) p.join(timeout=timeout)
finally:
g.kill() g.kill()
...@@ -295,7 +297,9 @@ class TestJoinSleep_raise_error(greentest.GenericWaitTestCase): ...@@ -295,7 +297,9 @@ class TestJoinSleep_raise_error(greentest.GenericWaitTestCase):
def wait(self, timeout): def wait(self, timeout):
p = pool.Pool() p = pool.Pool()
g = p.spawn(gevent.sleep, 10) g = p.spawn(gevent.sleep, 10)
try:
p.join(timeout=timeout, raise_error=True) p.join(timeout=timeout, raise_error=True)
finally:
g.kill() g.kill()
......
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