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

Method test_non_current

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

Source from the content-addressed store, hash-verified

460 io_loop2.close()
461
462 def test_non_current(self):
463 self.io_loop = IOLoop(make_current=False)
464 # The new IOLoop is not initially made current.
465 self.assertIsNone(IOLoop.current(instance=False))
466 # Starting the IOLoop makes it current, and stopping the loop
467 # makes it non-current. This process is repeatable.
468 for i in range(3):
469
470 def f():
471 self.current_io_loop = IOLoop.current()
472 assert self.io_loop is not None
473 self.io_loop.stop()
474
475 self.io_loop.add_callback(f)
476 self.io_loop.start()
477 self.assertIs(self.current_io_loop, self.io_loop)
478 # Now that the loop is stopped, it is no longer current.
479 self.assertIsNone(IOLoop.current(instance=False))
480
481 def test_force_current(self):
482 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