mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-107178: Add the C API tests for the Abstract Objects Layer (GH-107179)
Cover all the Mapping Protocol, almost all the Sequence Protocol (except PySequence_Fast) and a part of the Object Protocol. Move existing tests to Lib/test/test_capi/test_abstract.py and Modules/_testcapi/abstract.c. Add also tests for PyDict C API.
This commit is contained in:
parent
8579327879
commit
16c9415fba
13 changed files with 2174 additions and 297 deletions
|
@ -455,8 +455,8 @@ class ClassTests(unittest.TestCase):
|
|||
self.attr = 1
|
||||
|
||||
a = A()
|
||||
self.assertEqual(_testcapi.hasattr_string(a, "attr"), True)
|
||||
self.assertEqual(_testcapi.hasattr_string(a, "noattr"), False)
|
||||
self.assertEqual(_testcapi.object_hasattrstring(a, b"attr"), 1)
|
||||
self.assertEqual(_testcapi.object_hasattrstring(a, b"noattr"), 0)
|
||||
self.assertIsNone(sys.exception())
|
||||
|
||||
def testDel(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue