(self)
| 416 | sys.monitoring.restart_events() |
| 417 | |
| 418 | def test_restart(self): |
| 419 | try: |
| 420 | counter = CounterWithDisable() |
| 421 | sys.monitoring.register_callback(TEST_TOOL, E.PY_START, counter) |
| 422 | sys.monitoring.set_events(TEST_TOOL, E.PY_START) |
| 423 | counter.disable = True |
| 424 | f1() |
| 425 | counter.count = 0 |
| 426 | f1() |
| 427 | self.assertEqual(counter.count, 0) |
| 428 | sys.monitoring.restart_events() |
| 429 | counter.count = 0 |
| 430 | f1() |
| 431 | self.assertEqual(counter.count, 1) |
| 432 | sys.monitoring.set_events(TEST_TOOL, 0) |
| 433 | finally: |
| 434 | sys.monitoring.restart_events() |
| 435 | |
| 436 | |
| 437 | class MultipleMonitorsTest(MonitoringTestBase, unittest.TestCase): |
nothing calls this directly
no test coverage detected