Skip to content

Commit 388d91c

Browse files
authored
pythongh-109357: Fix test_monitoring.test_gh108976() (python#109358)
The test now calls free_tool_id() so it can be run multiple times in the same process. For example, the following command no longer fails: python -m test test_monitoring -R 3:3
1 parent b544c2b commit 388d91c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Lib/test/test_monitoring.py

+1
Original file line numberDiff line numberDiff line change
@@ -1721,6 +1721,7 @@ def make_foo_optimized_then_set_event():
17211721

17221722
def test_gh108976(self):
17231723
sys.monitoring.use_tool_id(0, "test")
1724+
self.addCleanup(sys.monitoring.free_tool_id, 0)
17241725
sys.monitoring.set_events(0, 0)
17251726
sys.monitoring.register_callback(0, E.LINE, lambda *args: sys.monitoring.set_events(0, 0))
17261727
sys.monitoring.register_callback(0, E.INSTRUCTION, lambda *args: 0)

0 commit comments

Comments
 (0)