MCPcopy Create free account
hub / github.com/EasyIME/PIME / test_spawn_callback

Method test_spawn_callback

python/python3/tornado/test/ioloop_test.py:373–385  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

371 self.wait()
372
373 def test_spawn_callback(self):
374 # Both add_callback and spawn_callback run directly on the IOLoop,
375 # so their errors are logged without stopping the test.
376 self.io_loop.add_callback(lambda: 1 / 0)
377 self.io_loop.add_callback(self.stop)
378 with ExpectLog(app_log, "Exception in callback"):
379 self.wait()
380 # A spawned callback is run directly on the IOLoop, so it will be
381 # logged without stopping the test.
382 self.io_loop.spawn_callback(lambda: 1 / 0)
383 self.io_loop.add_callback(self.stop)
384 with ExpectLog(app_log, "Exception in callback"):
385 self.wait()
386
387 @skipIfNonUnix
388 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