Commit d06e4b61 authored by Denis Bilenko's avatar Denis Bilenko

test__api.py: make sure test cases do not leak greenlets

--HG--
extra : transplant_source : %DCr%F9%F9%18p%A0Mt4%F1%CB%C8%1B%E6e%00%C0%8C%E8
parent d5ca6a79
......@@ -55,24 +55,27 @@ class Test(greentest.TestCase):
def test_sleep_invalid_switch(self):
p = gevent.spawn(util.wrap_errors(AssertionError, gevent.sleep), 2)
gevent.spawn(p.switch, None)
switcher = gevent.spawn(p.switch, None)
result = p.get()
assert isinstance(result, AssertionError), result
assert 'Invalid switch' in str(result), repr(str(result))
switcher.kill()
def test_wait_read_invalid_switch(self):
p = gevent.spawn(util.wrap_errors(AssertionError, socket.wait_read), 0)
gevent.spawn(p.switch, None)
switcher = gevent.spawn(p.switch, None)
result = p.get()
assert isinstance(result, AssertionError), result
assert 'Invalid switch' in str(result), repr(str(result))
switcher.kill()
def test_wait_write_invalid_switch(self):
p = gevent.spawn(util.wrap_errors(AssertionError, socket.wait_write), 0)
gevent.spawn(p.switch, None)
switcher = gevent.spawn(p.switch, None)
result = p.get()
assert isinstance(result, AssertionError), result
assert 'Invalid switch' in str(result), repr(str(result))
switcher.kill()
class TestTimers(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