diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2023-08-16 12:29:08 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-16 12:29:08 (GMT) |
commit | 9c8dfcec645b233dd6f36c286a7c5525c5d713e2 (patch) | |
tree | 2a0705468eac7a39b7ef30e903b2a14dc7b755e2 /Lib/test/test_class.py | |
parent | 72534ca85c64d4d33a9cf30492e037be05140fd2 (diff) | |
download | cpython-9c8dfcec645b233dd6f36c286a7c5525c5d713e2.zip cpython-9c8dfcec645b233dd6f36c286a7c5525c5d713e2.tar.gz cpython-9c8dfcec645b233dd6f36c286a7c5525c5d713e2.tar.bz2 |
[3.12] gh-107178: Add the C API tests for the Abstract Objects Layer (GH-107179) (#107728)
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..
(cherry picked from commit 16c9415fba4972743f1944ebc44946e475e68bc4)
Diffstat (limited to 'Lib/test/test_class.py')
-rw-r--r-- | Lib/test/test_class.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/test_class.py b/Lib/test/test_class.py index d7a48e5..7a15976 100644 --- a/Lib/test/test_class.py +++ b/Lib/test/test_class.py @@ -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): |