MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_timer

Method test_timer

Lib/test/test_asyncio/test_events.py:2597–2612  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2595 self.assertEqual(when, h.when())
2596
2597 def test_timer(self):
2598 def callback(*args):
2599 return args
2600
2601 args = (1, 2, 3)
2602 when = time.monotonic()
2603 h = asyncio.TimerHandle(when, callback, args, mock.Mock())
2604 self.assertIs(h._callback, callback)
2605 self.assertIs(h._args, args)
2606 self.assertFalse(h.cancelled())
2607
2608 # cancel
2609 h.cancel()
2610 self.assertTrue(h.cancelled())
2611 self.assertIsNone(h._callback)
2612 self.assertIsNone(h._args)
2613
2614
2615 def test_timer_repr(self):

Callers

nothing calls this directly

Calls 6

cancelMethod · 0.95
assertFalseMethod · 0.80
assertTrueMethod · 0.80
assertIsNoneMethod · 0.80
assertIsMethod · 0.45
cancelledMethod · 0.45

Tested by

no test coverage detected