mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
GH-129386: Use symbolic constants for specialization tests (GH-129415)
This commit is contained in:
parent
99ed3025fe
commit
002c4e2982
8 changed files with 152 additions and 132 deletions
|
@ -384,7 +384,9 @@ class EmbeddingTests(EmbeddingTestsMixin, unittest.TestCase):
|
|||
def test_specialized_static_code_gets_unspecialized_at_Py_FINALIZE(self):
|
||||
# https://github.com/python/cpython/issues/92031
|
||||
|
||||
code = textwrap.dedent("""\
|
||||
_testinternalcapi = import_helper.import_module("_testinternalcapi")
|
||||
|
||||
code = textwrap.dedent(f"""\
|
||||
import dis
|
||||
import importlib._bootstrap
|
||||
import opcode
|
||||
|
@ -411,7 +413,7 @@ class EmbeddingTests(EmbeddingTestsMixin, unittest.TestCase):
|
|||
|
||||
assert not is_specialized(func), "specialized instructions found"
|
||||
|
||||
for i in range(test.test_dis.ADAPTIVE_WARMUP_DELAY):
|
||||
for _ in range({_testinternalcapi.SPECIALIZATION_THRESHOLD}):
|
||||
func(importlib._bootstrap, ["x"], lambda *args: None)
|
||||
|
||||
assert is_specialized(func), "no specialized instructions found"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue