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

Method test_non_current

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

Source from the content-addressed store, hash-verified

455 self.io_loop.close()
456
457 def test_non_current(self):
458 self.io_loop = IOLoop(make_current=False)
459 # The new IOLoop is not initially made current.
460 self.assertIsNone(IOLoop.current(instance=False))
461 # Starting the IOLoop makes it current, and stopping the loop
462 # makes it non-current. This process is repeatable.
463 for i in range(3):
464
465 def f():
466 self.current_io_loop = IOLoop.current()
467 assert self.io_loop is not None
468 self.io_loop.stop()
469
470 self.io_loop.add_callback(f)
471 self.io_loop.start()
472 self.assertIs(self.current_io_loop, self.io_loop)
473 # Now that the loop is stopped, it is no longer current.
474 self.assertIsNone(IOLoop.current(instance=False))
475
476 def test_force_current(self):
477 self.io_loop = IOLoop(make_current=True)

Callers

nothing calls this directly

Calls 4

IOLoopClass · 0.90
currentMethod · 0.80
add_callbackMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected