Commit 579bac28 authored by Denis Bilenko's avatar Denis Bilenko

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

--HG--
extra : transplant_source : %D4%9E%3F%5BS%D4%93k%A5a%A7%F2%DD%90FQ%25%5C%80%A6
parent 28bae6ed
......@@ -286,8 +286,10 @@ class TestJoinSleep(greentest.GenericWaitTestCase):
def wait(self, timeout):
p = pool.Pool()
g = p.spawn(gevent.sleep, 10)
p.join(timeout=timeout)
g.kill()
try:
p.join(timeout=timeout)
finally:
g.kill()
class TestJoinSleep_raise_error(greentest.GenericWaitTestCase):
......@@ -295,8 +297,10 @@ class TestJoinSleep_raise_error(greentest.GenericWaitTestCase):
def wait(self, timeout):
p = pool.Pool()
g = p.spawn(gevent.sleep, 10)
p.join(timeout=timeout, raise_error=True)
g.kill()
try:
p.join(timeout=timeout, raise_error=True)
finally:
g.kill()
class TestJoinEmpty(greentest.TestCase):
......
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