MCPcopy
hub / github.com/tornadoweb/tornado / test_completes_before_timeout

Method test_completes_before_timeout

tornado/test/gen_test.py:735–741  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

733
734 @gen_test
735 def test_completes_before_timeout(self):
736 future = Future() # type: Future[str]
737 self.io_loop.add_timeout(
738 datetime.timedelta(seconds=0.1), lambda: future.set_result("asdf")
739 )
740 result = yield gen.with_timeout(datetime.timedelta(seconds=3600), future)
741 self.assertEqual(result, "asdf")
742
743 @gen_test
744 def test_fails_before_timeout(self):

Callers

nothing calls this directly

Calls 1

add_timeoutMethod · 0.80

Tested by

no test coverage detected