Skip to content

Commit 388d91c

Browse files
authored
gh-109357: Fix test_monitoring.test_gh108976() (#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

Lines changed: 1 addition & 0 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy