summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_dict.py
diff options
context:
space:
mode:
authorChristian Heimes <christian@python.org>2021-11-01 10:14:53 (GMT)
committerGitHub <noreply@github.com>2021-11-01 10:14:53 (GMT)
commite73283a20fb05b70da2990decefac0e011faec17 (patch)
treea490f99e1eab3e779b5828b8f51994e91b4aa2b6 /Lib/test/test_dict.py
parent762a4dc9361f9563e158e373ba8d767b4449f23d (diff)
downloadcpython-e73283a20fb05b70da2990decefac0e011faec17.zip
cpython-e73283a20fb05b70da2990decefac0e011faec17.tar.gz
cpython-e73283a20fb05b70da2990decefac0e011faec17.tar.bz2
bpo-45668: Fix PGO tests without test extensions (GH-29315)
Diffstat (limited to 'Lib/test/test_dict.py')
-rw-r--r--Lib/test/test_dict.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/test/test_dict.py b/Lib/test/test_dict.py
index b43c83a..32ffd38 100644
--- a/Lib/test/test_dict.py
+++ b/Lib/test/test_dict.py
@@ -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)