77import weakref
88
99from sys import monitoring
10- from test .support import is_wasi
10+ from test .support import threading_helper
1111from threading import Thread
1212from unittest import TestCase
1313
@@ -93,7 +93,7 @@ def tearDown(self):
9393 monitoring .free_tool_id (self .tool_id )
9494
9595
96- @unittest . skipIf ( is_wasi , "WASI has no threads." )
96+ @threading_helper . requires_working_threading ( )
9797class SetPreTraceMultiThreaded (InstrumentationMultiThreadedMixin , TestCase ):
9898 """Sets tracing one time after the threads have started"""
9999
@@ -112,7 +112,7 @@ def after_threads(self):
112112 sys .settrace (self .trace_func )
113113
114114
115- @unittest . skipIf ( is_wasi , "WASI has no threads." )
115+ @threading_helper . requires_working_threading ( )
116116class MonitoringMultiThreaded (
117117 MonitoringTestMixin , InstrumentationMultiThreadedMixin , TestCase
118118):
@@ -146,7 +146,7 @@ def during_threads(self):
146146 self .set = not self .set
147147
148148
149- @unittest . skipIf ( is_wasi , "WASI has no threads." )
149+ @threading_helper . requires_working_threading ( )
150150class SetTraceMultiThreaded (InstrumentationMultiThreadedMixin , TestCase ):
151151 """Uses sys.settrace and repeatedly toggles instrumentation on and off"""
152152
@@ -172,7 +172,7 @@ def during_threads(self):
172172 self .set = not self .set
173173
174174
175- @unittest . skipIf ( is_wasi , "WASI has no threads." )
175+ @threading_helper . requires_working_threading ( )
176176class SetProfileMultiThreaded (InstrumentationMultiThreadedMixin , TestCase ):
177177 """Uses sys.setprofile and repeatedly toggles instrumentation on and off"""
178178 thread_count = 25
@@ -201,7 +201,7 @@ def during_threads(self):
201201 self .set = not self .set
202202
203203
204- @unittest . skipIf ( is_wasi , "WASI has no threads." )
204+ @threading_helper . requires_working_threading ( )
205205class MonitoringMisc (MonitoringTestMixin , TestCase ):
206206 def register_callback (self ):
207207 def callback (* args ):
0 commit comments