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