Commit ce284562 authored by Denis Bilenko's avatar Denis Bilenko

test__api.py: update test for spawn_later

parent dd96ee31
......@@ -53,11 +53,14 @@ class Test(greentest.TestCase):
def test_killing_not_yet_started(self):
def func():
pass
g = gevent.spawn_later(2000, func)
assert not g.dead, g
g.kill(block=True)
assert g.dead, g
self.assertRaises(Exception, g.get)
g, timer = gevent.spawn_later(2000, func)
try:
assert not g.dead, g
g.kill(block=True)
assert g.dead, g
self.assertRaises(Exception, g.get)
finally:
timer.cancel()
def test_sleep_invalid_switch(self):
p = gevent.spawn(util.wrap_errors(AssertionError, gevent.sleep), 2)
......
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