bpo-40275: Use new test.support helper submodules in tests (GH-21315)
diff --git a/Lib/test/test_bytes.py b/Lib/test/test_bytes.py
index 770e2c5..61b4b91 100644
--- a/Lib/test/test_bytes.py
+++ b/Lib/test/test_bytes.py
@@ -16,6 +16,7 @@
import unittest
import test.support
+from test.support import import_helper
import test.string_tests
import test.list_tests
from test.support import bigaddrspacetest, MAX_Py_ssize_t
@@ -967,7 +968,7 @@
self.assertEqual(c, b'hllo')
def test_sq_item(self):
- _testcapi = test.support.import_module('_testcapi')
+ _testcapi = import_helper.import_module('_testcapi')
obj = self.type2test((42,))
with self.assertRaises(IndexError):
_testcapi.sequence_getitem(obj, -2)
@@ -1024,8 +1025,8 @@
# Test PyBytes_FromFormat()
def test_from_format(self):
- ctypes = test.support.import_module('ctypes')
- _testcapi = test.support.import_module('_testcapi')
+ ctypes = import_helper.import_module('ctypes')
+ _testcapi = import_helper.import_module('_testcapi')
from ctypes import pythonapi, py_object
from ctypes import (
c_int, c_uint,