mirror of
				https://github.com/python/cpython.git
				synced 2025-11-04 07:31:38 +00:00 
			
		
		
		
	bpo-29845: Mark tests that use _testcapi as CPython-only (#711)
This commit is contained in:
		
							parent
							
								
									6b5a9ec478
								
							
						
					
					
						commit
						24c738a9e9
					
				
					 5 changed files with 8 additions and 1 deletions
				
			
		| 
						 | 
					@ -2,8 +2,8 @@
 | 
				
			||||||
from ctypes import *
 | 
					from ctypes import *
 | 
				
			||||||
from ctypes.test import need_symbol
 | 
					from ctypes.test import need_symbol
 | 
				
			||||||
from struct import calcsize
 | 
					from struct import calcsize
 | 
				
			||||||
import _testcapi
 | 
					 | 
				
			||||||
import _ctypes_test
 | 
					import _ctypes_test
 | 
				
			||||||
 | 
					import test.support
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class SubclassesTest(unittest.TestCase):
 | 
					class SubclassesTest(unittest.TestCase):
 | 
				
			||||||
    def test_subclass(self):
 | 
					    def test_subclass(self):
 | 
				
			||||||
| 
						 | 
					@ -202,7 +202,10 @@ class X(Structure):
 | 
				
			||||||
             "_pack_": -1}
 | 
					             "_pack_": -1}
 | 
				
			||||||
        self.assertRaises(ValueError, type(Structure), "X", (Structure,), d)
 | 
					        self.assertRaises(ValueError, type(Structure), "X", (Structure,), d)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @test.support.cpython_only
 | 
				
			||||||
 | 
					    def test_packed_c_limits(self):
 | 
				
			||||||
        # Issue 15989
 | 
					        # Issue 15989
 | 
				
			||||||
 | 
					        import _testcapi
 | 
				
			||||||
        d = {"_fields_": [("a", c_byte)],
 | 
					        d = {"_fields_": [("a", c_byte)],
 | 
				
			||||||
             "_pack_": _testcapi.INT_MAX + 1}
 | 
					             "_pack_": _testcapi.INT_MAX + 1}
 | 
				
			||||||
        self.assertRaises(ValueError, type(Structure), "X", (Structure,), d)
 | 
					        self.assertRaises(ValueError, type(Structure), "X", (Structure,), d)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -143,6 +143,7 @@ def test_bound_methods(self):
 | 
				
			||||||
        self.assertEqual(l, [5])
 | 
					        self.assertEqual(l, [5])
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@support.cpython_only
 | 
				
			||||||
class SubinterpreterTest(unittest.TestCase):
 | 
					class SubinterpreterTest(unittest.TestCase):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def test_callbacks_leak(self):
 | 
					    def test_callbacks_leak(self):
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2117,6 +2117,7 @@ def wrap(gen):
 | 
				
			||||||
            sys.set_coroutine_wrapper(None)
 | 
					            sys.set_coroutine_wrapper(None)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@support.cpython_only
 | 
				
			||||||
class CAPITest(unittest.TestCase):
 | 
					class CAPITest(unittest.TestCase):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def test_tp_await_1(self):
 | 
					    def test_tp_await_1(self):
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -906,6 +906,7 @@ def testNtoH(self):
 | 
				
			||||||
            self.assertEqual(swapped & mask, mask)
 | 
					            self.assertEqual(swapped & mask, mask)
 | 
				
			||||||
            self.assertRaises(OverflowError, func, 1<<34)
 | 
					            self.assertRaises(OverflowError, func, 1<<34)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @support.cpython_only
 | 
				
			||||||
    def testNtoHErrors(self):
 | 
					    def testNtoHErrors(self):
 | 
				
			||||||
        import _testcapi
 | 
					        import _testcapi
 | 
				
			||||||
        s_good_values = [0, 1, 2, 0xffff]
 | 
					        s_good_values = [0, 1, 2, 0xffff]
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -865,6 +865,7 @@ def test_sys_xoptions_invalid(self):
 | 
				
			||||||
                                  b'number of frames',
 | 
					                                  b'number of frames',
 | 
				
			||||||
                                  stderr)
 | 
					                                  stderr)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @unittest.skipIf(_testcapi is None, 'need _testcapi')
 | 
				
			||||||
    def test_pymem_alloc0(self):
 | 
					    def test_pymem_alloc0(self):
 | 
				
			||||||
        # Issue #21639: Check that PyMem_Malloc(0) with tracemalloc enabled
 | 
					        # Issue #21639: Check that PyMem_Malloc(0) with tracemalloc enabled
 | 
				
			||||||
        # does not crash.
 | 
					        # does not crash.
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue