MCPcopy Index your code
hub / github.com/python/cpython / test_timer_repr_debug

Method test_timer_repr_debug

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

Source from the content-addressed store, hash-verified

2624 '<TimerHandle cancelled when=123>')
2625
2626 def test_timer_repr_debug(self):
2627 self.loop.get_debug.return_value = True
2628
2629 # simple function
2630 create_filename = __file__
2631 create_lineno = sys._getframe().f_lineno + 1
2632 h = asyncio.TimerHandle(123, noop, (), self.loop)
2633 filename, lineno = test_utils.get_function_source(noop)
2634 self.assertEqual(repr(h),
2635 '<TimerHandle when=123 noop() '
2636 'at %s:%s created at %s:%s>'
2637 % (filename, lineno, create_filename, create_lineno))
2638
2639 # cancelled handle
2640 h.cancel()
2641 self.assertEqual(repr(h),
2642 '<TimerHandle cancelled when=123 noop() '
2643 'at %s:%s created at %s:%s>'
2644 % (filename, lineno, create_filename, create_lineno))
2645
2646
2647 def test_timer_comparison(self):

Callers

nothing calls this directly

Calls 2

cancelMethod · 0.95
assertEqualMethod · 0.45

Tested by

no test coverage detected