(self)
| 402 | test_thread(self.loop, False, create_loop=True) |
| 403 | |
| 404 | def test__run_once(self): |
| 405 | h1 = asyncio.TimerHandle(time.monotonic() + 5.0, lambda: True, (), |
| 406 | self.loop, None) |
| 407 | h2 = asyncio.TimerHandle(time.monotonic() + 10.0, lambda: True, (), |
| 408 | self.loop, None) |
| 409 | |
| 410 | h1.cancel() |
| 411 | |
| 412 | self.loop._process_events = mock.Mock() |
| 413 | self.loop._scheduled.append(h1) |
| 414 | self.loop._scheduled.append(h2) |
| 415 | self.loop._run_once() |
| 416 | |
| 417 | t = self.loop._selector.select.call_args[0][0] |
| 418 | self.assertTrue(9.5 < t < 10.5, t) |
| 419 | self.assertEqual([h2], self.loop._scheduled) |
| 420 | self.assertTrue(self.loop._process_events.called) |
| 421 | |
| 422 | def test_set_debug(self): |
| 423 | self.loop.set_debug(True) |
nothing calls this directly
no test coverage detected