mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
bpo-45668: Fix PGO tests without test extensions (GH-29315)
This commit is contained in:
parent
762a4dc936
commit
e73283a20f
13 changed files with 60 additions and 28 deletions
|
@ -8,6 +8,7 @@ import sys
|
|||
import unittest
|
||||
import weakref
|
||||
from test import support
|
||||
from test.support import import_helper
|
||||
|
||||
|
||||
class DictTest(unittest.TestCase):
|
||||
|
@ -1541,7 +1542,8 @@ class CAPITest(unittest.TestCase):
|
|||
# Test _PyDict_GetItem_KnownHash()
|
||||
@support.cpython_only
|
||||
def test_getitem_knownhash(self):
|
||||
from _testcapi import dict_getitem_knownhash
|
||||
_testcapi = import_helper.import_module('_testcapi')
|
||||
dict_getitem_knownhash = _testcapi.dict_getitem_knownhash
|
||||
|
||||
d = {'x': 1, 'y': 2, 'z': 3}
|
||||
self.assertEqual(dict_getitem_knownhash(d, 'x', hash('x')), 1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue