(self)
| 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: |
nothing calls this directly
no test coverage detected