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

Method test_lines_loop

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected