Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 53e2ad4

Browse filesBrowse files
committed
gh-116417: Move limited C API abstract.c tests to _testlimitedcapi
Split abstract.c and float.c tests of _testcapi into two parts: limited C API tests in _testlimitedcapi and non-limited C API tests in _testcapi. Update test_bytes.
1 parent a3cf0fa commit 53e2ad4
Copy full SHA for 53e2ad4

File tree

Expand file treeCollapse file tree

12 files changed

+771
-719
lines changed
Filter options
Expand file treeCollapse file tree

12 files changed

+771
-719
lines changed

‎Lib/test/test_bytes.py

Copy file name to clipboardExpand all lines: Lib/test/test_bytes.py
+8-8Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -991,13 +991,13 @@ def test_translate(self):
991991
self.assertEqual(c, b'hllo')
992992

993993
def test_sq_item(self):
994-
_testcapi = import_helper.import_module('_testcapi')
994+
_testlimitedcapi = import_helper.import_module('_testlimitedcapi')
995995
obj = self.type2test((42,))
996996
with self.assertRaises(IndexError):
997-
_testcapi.sequence_getitem(obj, -2)
997+
_testlimitedcapi.sequence_getitem(obj, -2)
998998
with self.assertRaises(IndexError):
999-
_testcapi.sequence_getitem(obj, 1)
1000-
self.assertEqual(_testcapi.sequence_getitem(obj, 0), 42)
999+
_testlimitedcapi.sequence_getitem(obj, 1)
1000+
self.assertEqual(_testlimitedcapi.sequence_getitem(obj, 0), 42)
10011001

10021002

10031003
class BytesTest(BaseBytesTest, unittest.TestCase):
@@ -1256,7 +1256,7 @@ class SubBytes(bytes):
12561256
class ByteArrayTest(BaseBytesTest, unittest.TestCase):
12571257
type2test = bytearray
12581258

1259-
_testcapi = import_helper.import_module('_testcapi')
1259+
_testlimitedcapi = import_helper.import_module('_testlimitedcapi')
12601260

12611261
def test_getitem_error(self):
12621262
b = bytearray(b'python')
@@ -1354,7 +1354,7 @@ def setitem_as_mapping(b, i, val):
13541354
b[i] = val
13551355

13561356
def setitem_as_sequence(b, i, val):
1357-
self._testcapi.sequence_setitem(b, i, val)
1357+
self._testlimitedcapi.sequence_setitem(b, i, val)
13581358

13591359
def do_tests(setitem):
13601360
b = bytearray([1, 2, 3])
@@ -1401,7 +1401,7 @@ def del_as_mapping(b, i):
14011401
del b[i]
14021402

14031403
def del_as_sequence(b, i):
1404-
self._testcapi.sequence_delitem(b, i)
1404+
self._testlimitedcapi.sequence_delitem(b, i)
14051405

14061406
def do_tests(delete):
14071407
b = bytearray(range(10))
@@ -1810,7 +1810,7 @@ def __index__(self):
18101810
with self.subTest("tp_as_sequence"):
18111811
b = bytearray(b'Now you see me...')
18121812
with self.assertRaises(IndexError):
1813-
self._testcapi.sequence_setitem(b, 0, Boom())
1813+
self._testlimitedcapi.sequence_setitem(b, 0, Boom())
18141814

18151815

18161816
class AssortedBytesTest(unittest.TestCase):

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.