mirror of
https://github.com/python/cpython.git
synced 2025-11-02 03:01:58 +00:00
gh-118362: Skip tests when threading isn't available (#118666)
* Skip tests when threads aren't available * Use ThreadPoolExecutor
This commit is contained in:
parent
636b8d94c9
commit
e272195b3e
3 changed files with 16 additions and 16 deletions
|
|
@ -7,7 +7,7 @@ import unittest
|
|||
import weakref
|
||||
|
||||
from sys import monitoring
|
||||
from test.support import is_wasi
|
||||
from test.support import threading_helper
|
||||
from threading import Thread, _PyRLock
|
||||
from unittest import TestCase
|
||||
|
||||
|
|
@ -87,7 +87,7 @@ class MonitoringTestMixin:
|
|||
monitoring.free_tool_id(self.tool_id)
|
||||
|
||||
|
||||
@unittest.skipIf(is_wasi, "WASI has no threads.")
|
||||
@threading_helper.requires_working_threading()
|
||||
class SetPreTraceMultiThreaded(InstrumentationMultiThreadedMixin, TestCase):
|
||||
"""Sets tracing one time after the threads have started"""
|
||||
|
||||
|
|
@ -106,7 +106,7 @@ class SetPreTraceMultiThreaded(InstrumentationMultiThreadedMixin, TestCase):
|
|||
sys.settrace(self.trace_func)
|
||||
|
||||
|
||||
@unittest.skipIf(is_wasi, "WASI has no threads.")
|
||||
@threading_helper.requires_working_threading()
|
||||
class MonitoringMultiThreaded(
|
||||
MonitoringTestMixin, InstrumentationMultiThreadedMixin, TestCase
|
||||
):
|
||||
|
|
@ -140,7 +140,7 @@ class MonitoringMultiThreaded(
|
|||
self.set = not self.set
|
||||
|
||||
|
||||
@unittest.skipIf(is_wasi, "WASI has no threads.")
|
||||
@threading_helper.requires_working_threading()
|
||||
class SetTraceMultiThreaded(InstrumentationMultiThreadedMixin, TestCase):
|
||||
"""Uses sys.settrace and repeatedly toggles instrumentation on and off"""
|
||||
|
||||
|
|
@ -166,7 +166,7 @@ class SetTraceMultiThreaded(InstrumentationMultiThreadedMixin, TestCase):
|
|||
self.set = not self.set
|
||||
|
||||
|
||||
@unittest.skipIf(is_wasi, "WASI has no threads.")
|
||||
@threading_helper.requires_working_threading()
|
||||
class SetProfileMultiThreaded(InstrumentationMultiThreadedMixin, TestCase):
|
||||
"""Uses sys.setprofile and repeatedly toggles instrumentation on and off"""
|
||||
|
||||
|
|
@ -192,7 +192,7 @@ class SetProfileMultiThreaded(InstrumentationMultiThreadedMixin, TestCase):
|
|||
self.set = not self.set
|
||||
|
||||
|
||||
@unittest.skipIf(is_wasi, "WASI has no threads.")
|
||||
@threading_helper.requires_working_threading()
|
||||
class MonitoringMisc(MonitoringTestMixin, TestCase):
|
||||
def register_callback(self):
|
||||
def callback(*args):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue