You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
485 B
Python
24 lines
485 B
Python
5 years ago
|
import unittest
|
||
|
|
||
|
import gevent
|
||
|
|
||
|
class Test(unittest.TestCase):
|
||
|
|
||
|
def test(self):
|
||
|
# hub.join() guarantees that loop has exited cleanly
|
||
|
res = gevent.get_hub().join()
|
||
|
self.assertTrue(res)
|
||
|
|
||
|
res = gevent.get_hub().join()
|
||
|
self.assertTrue(res)
|
||
|
|
||
|
# but it is still possible to use gevent afterwards
|
||
|
gevent.sleep(0.01)
|
||
|
|
||
|
res = gevent.get_hub().join()
|
||
|
self.assertTrue(res)
|
||
|
|
||
|
|
||
|
if __name__ == '__main__':
|
||
|
unittest.main()
|