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

Method test_wait_timeout

tornado/test/testing_test.py:32–48  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

30
31class AsyncTestCaseTest(AsyncTestCase):
32 def test_wait_timeout(self):
33 time = self.io_loop.time
34
35 # Accept default 5-second timeout, no error
36 self.io_loop.add_timeout(time() + 0.01, self.stop)
37 self.wait()
38
39 # Timeout passed to wait()
40 self.io_loop.add_timeout(time() + 1, self.stop)
41 with self.assertRaises(self.failureException):
42 self.wait(timeout=0.01)
43
44 # Timeout set with environment variable
45 self.io_loop.add_timeout(time() + 1, self.stop)
46 with set_environ("ASYNC_TEST_TIMEOUT", "0.01"):
47 with self.assertRaises(self.failureException):
48 self.wait()
49
50 def test_subsequent_wait_calls(self):
51 """

Callers

nothing calls this directly

Calls 3

set_environFunction · 0.85
add_timeoutMethod · 0.80
waitMethod · 0.45

Tested by

no test coverage detected