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

Method test_lines_loop

Lib/test/test_monitoring.py:591–612  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

589 sys.monitoring.restart_events()
590
591 def test_lines_loop(self):
592 try:
593 self.assertEqual(sys.monitoring._all_events(), {})
594 events = []
595 recorder = RecorderWithDisable(events)
596 sys.monitoring.register_callback(TEST_TOOL, E.LINE, recorder)
597 sys.monitoring.set_events(TEST_TOOL, E.LINE)
598 floop()
599 sys.monitoring.set_events(TEST_TOOL, 0)
600 sys.monitoring.register_callback(TEST_TOOL, E.LINE, None)
601 start = nth_line(LineMonitoringTest.test_lines_loop, 0)
602 floop_1 = nth_line(floop, 1)
603 floop_2 = nth_line(floop, 2)
604 self.assertEqual(
605 events,
606 [start+7, floop_1, floop_2, floop_1, floop_2, floop_1, start+8]
607 )
608 finally:
609 sys.monitoring.set_events(TEST_TOOL, 0)
610 sys.monitoring.register_callback(TEST_TOOL, E.LINE, None)
611 self.assertEqual(sys.monitoring._all_events(), {})
612 sys.monitoring.restart_events()
613
614 def test_lines_two(self):
615 try:

Callers

nothing calls this directly

Calls 6

RecorderWithDisableClass · 0.85
floopFunction · 0.85
nth_lineFunction · 0.85
assertEqualMethod · 0.45
register_callbackMethod · 0.45
restart_eventsMethod · 0.45

Tested by

no test coverage detected