GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-116417: Move limited C API abstract.c tests to _testlimitedcapi · python/cpython@53e2ad4

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • Lib/test
    • test_bytes.py
    • test_capi
      • test_abstract.py
      • test_float.py
  • Modules
    • Setup.stdlib.in
    • _testcapi
      • abstract.c
      • float.c
    • _testlimitedcapi.c
    • _testlimitedcapi
      • abstract.c
      • float.c
      • parts.h
  • PCbuild
    • _testlimitedcapi.vcxproj.filters
    • _testlimitedcapi.vcxproj
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎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)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.