Commit e0ae1fdf authored by Denis Bilenko's avatar Denis Bilenko

test__hub.py: fix test from failing on Python2.4

parent aadc5b9f
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
import greentest import greentest
import unittest import unittest
import time import time
import re
import gevent import gevent
from gevent import core from gevent import core
from gevent import socket from gevent import socket
...@@ -165,13 +166,13 @@ class TestWaiter(greentest.GenericWaitTestCase): ...@@ -165,13 +166,13 @@ class TestWaiter(greentest.GenericWaitTestCase):
waiter = Waiter() waiter = Waiter()
waiter.throw(ZeroDivisionError) waiter.throw(ZeroDivisionError)
self.assertEqual(str(waiter), "<Waiter greenlet=None exc_info=(<type 'exceptions.ZeroDivisionError'>,)>") assert re.match('^<Waiter greenlet=None exc_info=.*ZeroDivisionError.*$', str(waiter)), str(waiter)
self.assertRaises(ZeroDivisionError, waiter.get) self.assertRaises(ZeroDivisionError, waiter.get)
waiter = Waiter() waiter = Waiter()
gevent.spawn(waiter.get) gevent.spawn(waiter.get)
gevent.sleep(0) gevent.sleep(0)
assert str(waiter).startswith('<Waiter greenlet=<Greenlet at 0x'), str(waiter) assert str(waiter).startswith('<Waiter greenlet=<Greenlet at '), str(waiter)
if __name__=='__main__': if __name__=='__main__':
......
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