File tree Expand file tree Collapse file tree 4 files changed +14
-3
lines changed Expand file tree Collapse file tree 4 files changed +14
-3
lines changed Original file line number Diff line number Diff line change 88
99import _testinternalcapi
1010
11- from test .support import script_helper
11+ from test .support import script_helper , requires_specialization
1212
1313
1414@contextlib .contextmanager
@@ -31,6 +31,7 @@ def clear_executors(func):
3131 func .__code__ = func .__code__ .replace ()
3232
3333
34+ @requires_specialization
3435class TestOptimizerAPI (unittest .TestCase ):
3536
3637 def test_new_counter_optimizer_dealloc (self ):
@@ -133,6 +134,7 @@ def get_opnames(ex):
133134 return set (iter_opnames (ex ))
134135
135136
137+ @requires_specialization
136138class TestExecutorInvalidation (unittest .TestCase ):
137139
138140 def setUp (self ):
@@ -210,6 +212,7 @@ def f():
210212 exe = get_first_executor (f )
211213 self .assertIsNone (exe )
212214
215+ @requires_specialization
213216class TestUops (unittest .TestCase ):
214217
215218 def test_basic_loop (self ):
Original file line number Diff line number Diff line change 99import types
1010import unittest
1111import asyncio
12+ from test .support import requires_specialization
1213
1314PAIR = (0 ,1 )
1415
@@ -815,6 +816,9 @@ def func1():
815816
816817 self .check_events (func1 , [("raise" , KeyError )])
817818
819+ # gh-116090: This test doesn't really require specialization, but running
820+ # it without specialization exposes a monitoring bug.
821+ @requires_specialization
818822 def test_implicit_stop_iteration (self ):
819823
820824 def gen ():
@@ -963,6 +967,7 @@ def func():
963967 )
964968 self .assertEqual (events [0 ], ("throw" , IndexError ))
965969
970+ @requires_specialization
966971 def test_no_unwind_for_shim_frame (self ):
967972
968973 class B :
Original file line number Diff line number Diff line change 44import threading
55import types
66import unittest
7- from test .support import threading_helper , check_impl_detail
7+ from test .support import threading_helper , check_impl_detail , requires_specialization
88
99# Skip this module on other interpreters, it is cpython specific:
1010if check_impl_detail (cpython = False ):
@@ -506,6 +506,7 @@ def f(x, y):
506506
507507
508508@threading_helper .requires_working_threading ()
509+ @requires_specialization
509510class TestRacesDoNotCrash (unittest .TestCase ):
510511 # Careful with these. Bigger numbers have a higher chance of catching bugs,
511512 # but you can also burn through a *ton* of type/dict/function versions:
@@ -1021,6 +1022,7 @@ def write(items):
10211022class C :
10221023 pass
10231024
1025+ @requires_specialization
10241026class TestInstanceDict (unittest .TestCase ):
10251027
10261028 def setUp (self ):
Original file line number Diff line number Diff line change 22import unittest
33import dis
44from test import support
5- from test .support import import_helper
5+ from test .support import import_helper , requires_specialization
66try :
77 from sys import _clear_type_cache
88except ImportError :
@@ -94,6 +94,7 @@ class C:
9494
9595
9696@support .cpython_only
97+ @requires_specialization
9798class TypeCacheWithSpecializationTests (unittest .TestCase ):
9899 def tearDown (self ):
99100 _clear_type_cache ()
You can’t perform that action at this time.
0 commit comments