def test_wait_future_timeout(self): @tornado.gen.coroutine def test_func(): yield sleep(60.0) try: yield wait_future(test_func(), 0.1) except TimedOut: pass else: self.assertTrue(False)
def test_wait_future_error(self): @tornado.gen.coroutine def test_func(): yield sleep(0.1) raise ValueError('uh-oh') try: yield wait_future(test_func(), 2.0) except ValueError as error: self.assertEqual('uh-oh', error.args[0]) else: self.assertTrue(False)
def test_wait_future_none(self): @tornado.gen.coroutine def test_func(): yield sleep(0.1) yield wait_future(test_func(), None)