(self)
| 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) |
nothing calls this directly
no test coverage detected