from ctypes import *
from ctypes.test import need_symbol
from struct import calcsize
-import _testcapi
import _ctypes_test
+import test.support
class SubclassesTest(unittest.TestCase):
def test_subclass(self):
"_pack_": -1}
self.assertRaises(ValueError, type(Structure), "X", (Structure,), d)
+ @test.support.cpython_only
+ def test_packed_c_limits(self):
# Issue 15989
+ import _testcapi
d = {"_fields_": [("a", c_byte)],
"_pack_": _testcapi.INT_MAX + 1}
self.assertRaises(ValueError, type(Structure), "X", (Structure,), d)
self.assertEqual(l, [5])
+@support.cpython_only
class SubinterpreterTest(unittest.TestCase):
def test_callbacks_leak(self):
sys.set_coroutine_wrapper(None)
+@support.cpython_only
class CAPITest(unittest.TestCase):
def test_tp_await_1(self):
self.assertEqual(swapped & mask, mask)
self.assertRaises(OverflowError, func, 1<<34)
+ @support.cpython_only
def testNtoHErrors(self):
good_values = [ 1, 2, 3, 1, 2, 3 ]
bad_values = [ -1, -2, -3, -1, -2, -3 ]
b'number of frames',
stderr)
+ @support.cpython_only
def test_pymem_alloc0(self):
# Issue #21639: Check that PyMem_Malloc(0) with tracemalloc enabled
# does not crash.