(self)
| 612 | sys.monitoring.restart_events() |
| 613 | |
| 614 | def test_lines_two(self): |
| 615 | try: |
| 616 | self.assertEqual(sys.monitoring._all_events(), {}) |
| 617 | events = [] |
| 618 | recorder = RecorderWithDisable(events) |
| 619 | events2 = [] |
| 620 | recorder2 = RecorderWithDisable(events2) |
| 621 | sys.monitoring.register_callback(TEST_TOOL, E.LINE, recorder) |
| 622 | sys.monitoring.register_callback(TEST_TOOL2, E.LINE, recorder2) |
| 623 | sys.monitoring.set_events(TEST_TOOL, E.LINE); sys.monitoring.set_events(TEST_TOOL2, E.LINE) |
| 624 | f1() |
| 625 | sys.monitoring.set_events(TEST_TOOL, 0); sys.monitoring.set_events(TEST_TOOL2, 0) |
| 626 | sys.monitoring.register_callback(TEST_TOOL, E.LINE, None) |
| 627 | sys.monitoring.register_callback(TEST_TOOL2, E.LINE, None) |
| 628 | start = nth_line(LineMonitoringTest.test_lines_two, 0) |
| 629 | expected = [start+10, nth_line(f1, 1), start+11] |
| 630 | self.assertEqual(events, expected) |
| 631 | self.assertEqual(events2, expected) |
| 632 | finally: |
| 633 | sys.monitoring.set_events(TEST_TOOL, 0) |
| 634 | sys.monitoring.set_events(TEST_TOOL2, 0) |
| 635 | sys.monitoring.register_callback(TEST_TOOL, E.LINE, None) |
| 636 | sys.monitoring.register_callback(TEST_TOOL2, E.LINE, None) |
| 637 | self.assertEqual(sys.monitoring._all_events(), {}) |
| 638 | sys.monitoring.restart_events() |
| 639 | |
| 640 | def check_lines(self, func, expected, tool=TEST_TOOL): |
| 641 | try: |
nothing calls this directly
no test coverage detected