gh-116417: Move limited C API abstract.c tests to _testlimitedcapi (#116986)

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 and test_class.
This commit is contained in:
Victor Stinner 2024-03-19 11:44:13 +01:00 committed by GitHub
parent b1bc37597f
commit 039d20ae54
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 780 additions and 728 deletions

View file

@ -448,15 +448,15 @@ class ClassTests(unittest.TestCase):
def testHasAttrString(self):
import sys
from test.support import import_helper
_testcapi = import_helper.import_module('_testcapi')
_testlimitedcapi = import_helper.import_module('_testlimitedcapi')
class A:
def __init__(self):
self.attr = 1
a = A()
self.assertEqual(_testcapi.object_hasattrstring(a, b"attr"), 1)
self.assertEqual(_testcapi.object_hasattrstring(a, b"noattr"), 0)
self.assertEqual(_testlimitedcapi.object_hasattrstring(a, b"attr"), 1)
self.assertEqual(_testlimitedcapi.object_hasattrstring(a, b"noattr"), 0)
self.assertIsNone(sys.exception())
def testDel(self):