mirror of
https://github.com/python/cpython.git
synced 2025-10-17 04:08:28 +00:00
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:
parent
b1bc37597f
commit
039d20ae54
13 changed files with 780 additions and 728 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue