(self)
| 571 | class LineMonitoringTest(MonitoringTestBase, unittest.TestCase): |
| 572 | |
| 573 | def test_lines_single(self): |
| 574 | try: |
| 575 | self.assertEqual(sys.monitoring._all_events(), {}) |
| 576 | events = [] |
| 577 | recorder = RecorderWithDisable(events) |
| 578 | sys.monitoring.register_callback(TEST_TOOL, E.LINE, recorder) |
| 579 | sys.monitoring.set_events(TEST_TOOL, E.LINE) |
| 580 | f1() |
| 581 | sys.monitoring.set_events(TEST_TOOL, 0) |
| 582 | sys.monitoring.register_callback(TEST_TOOL, E.LINE, None) |
| 583 | start = nth_line(LineMonitoringTest.test_lines_single, 0) |
| 584 | self.assertEqual(events, [start+7, nth_line(f1, 1), start+8]) |
| 585 | finally: |
| 586 | sys.monitoring.set_events(TEST_TOOL, 0) |
| 587 | sys.monitoring.register_callback(TEST_TOOL, E.LINE, None) |
| 588 | self.assertEqual(sys.monitoring._all_events(), {}) |
| 589 | sys.monitoring.restart_events() |
| 590 | |
| 591 | def test_lines_loop(self): |
| 592 | try: |
nothing calls this directly
no test coverage detected