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 ):
@@ -211,6 +213,7 @@ def f():
211213 self .assertIsNone (exe )
212214
213215
216+ @requires_specialization
214217@unittest .skipIf (os .getenv ("PYTHON_UOPS_OPTIMIZE" ) == "0" , "Needs uop optimizer to run." )
215218class TestUops (unittest .TestCase ):
216219
@@ -572,6 +575,7 @@ def testfunc(n):
572575 self .assertLessEqual (count , 2 )
573576
574577
578+ @requires_specialization
575579@unittest .skipIf (os .getenv ("PYTHON_UOPS_OPTIMIZE" ) == "0" , "Needs uop optimizer to run." )
576580class TestUopsOptimization (unittest .TestCase ):
577581
0 commit comments