Commit 32fa7dec authored by Denis Bilenko's avatar Denis Bilenko

test__hub.py: disable TestSignal on platforms where SIGALRM is not available (windows)

parent ab4e1841
......@@ -146,20 +146,21 @@ class Expected(Exception):
pass
class TestSignal(greentest.TestCase):
__timeout__ = 2
def test_exception_goes_to_MAIN(self):
def handler():
raise Expected('TestSignal')
gevent.signal(signal.SIGALRM, handler)
signal.alarm(1)
try:
gevent.sleep(1.1)
raise AssertionError('must raise Expected')
except Expected, ex:
assert str(ex) == 'TestSignal', ex
if hasattr(signal, 'SIGALRM'):
class TestSignal(greentest.TestCase):
__timeout__ = 2
def test_exception_goes_to_MAIN(self):
def handler():
raise Expected('TestSignal')
gevent.signal(signal.SIGALRM, handler)
signal.alarm(1)
try:
gevent.spawn(gevent.sleep, 2).join()
raise AssertionError('must raise Expected')
except Expected, ex:
assert str(ex) == 'TestSignal', ex
class TestWaiter(greentest.GenericWaitTestCase):
......
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