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

Method test_spawn_callback

tornado/test/ioloop_test.py:377–389  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

375 self.wait()
376
377 def test_spawn_callback(self):
378 # Both add_callback and spawn_callback run directly on the IOLoop,
379 # so their errors are logged without stopping the test.
380 self.io_loop.add_callback(lambda: 1 / 0)
381 self.io_loop.add_callback(self.stop)
382 with ExpectLog(app_log, "Exception in callback"):
383 self.wait()
384 # A spawned callback is run directly on the IOLoop, so it will be
385 # logged without stopping the test.
386 self.io_loop.spawn_callback(lambda: 1 / 0)
387 self.io_loop.add_callback(self.stop)
388 with ExpectLog(app_log, "Exception in callback"):
389 self.wait()
390
391 @skipIfNonUnix
392 def test_remove_handler_from_handler(self):

Callers

nothing calls this directly

Calls 4

ExpectLogClass · 0.90
spawn_callbackMethod · 0.80
add_callbackMethod · 0.45
waitMethod · 0.45

Tested by

no test coverage detected