mirror of
https://github.com/python/cpython.git
synced 2025-08-27 04:05:34 +00:00
bpo-40275: Use new test.support helper submodules in tests (GH-21315)
This commit is contained in:
parent
883bc63833
commit
a089d21df1
20 changed files with 69 additions and 49 deletions
|
@ -16,6 +16,7 @@ import textwrap
|
|||
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 @@ class BaseBytesTest:
|
|||
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 @@ class BytesTest(BaseBytesTest, unittest.TestCase):
|
|||
|
||||
# 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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue