Commit abc73841 authored by Denis Bilenko's avatar Denis Bilenko

add test for issue #20

parent a9bae010
......@@ -125,6 +125,20 @@ class TestSleep(greentest.GenericWaitTestCase):
def wait(self, timeout):
gevent.sleep(timeout)
def test_negative(self):
self.switch_expected = False
self.assertRaises(IOError, gevent.sleep, -1)
from time import sleep as real_sleep
try:
real_sleep(-1.1)
except IOError, real_ex:
pass
try:
gevent.sleep(-1.1)
except IOError, gevent_ex:
pass
self.assertEqual(repr(gevent_ex), repr(real_ex))
class Expected(Exception):
pass
......
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