Skip to content

Commit 20b081c

Browse files
committed
Mark some tests that require specialization
1 parent c98987b commit 20b081c

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

Lib/test/test_capi/test_opt.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import _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
3435
class 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
136138
class 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
213216
class TestUops(unittest.TestCase):
214217

215218
def test_basic_loop(self):

Lib/test/test_monitoring.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import types
1010
import unittest
1111
import asyncio
12+
from test.support import requires_specialization
1213

1314
PAIR = (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:

Lib/test/test_opcache.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import threading
55
import types
66
import 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:
1010
if check_impl_detail(cpython=False):
@@ -506,6 +506,7 @@ def f(x, y):
506506

507507

508508
@threading_helper.requires_working_threading()
509+
@requires_specialization
509510
class 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):
10211022
class C:
10221023
pass
10231024

1025+
@requires_specialization
10241026
class TestInstanceDict(unittest.TestCase):
10251027

10261028
def setUp(self):

Lib/test/test_type_cache.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import unittest
33
import dis
44
from test import support
5-
from test.support import import_helper
5+
from test.support import import_helper, requires_specialization
66
try:
77
from sys import _clear_type_cache
88
except ImportError:
@@ -94,6 +94,7 @@ class C:
9494

9595

9696
@support.cpython_only
97+
@requires_specialization
9798
class TypeCacheWithSpecializationTests(unittest.TestCase):
9899
def tearDown(self):
99100
_clear_type_cache()

0 commit comments

Comments
 (0)