]> granicus.if.org Git - python/commitdiff
bpo-29845: Mark tests that use _testcapi as CPython-only (#711)
authorSerhiy Storchaka <storchaka@gmail.com>
Sun, 19 Mar 2017 18:20:10 +0000 (20:20 +0200)
committerGitHub <noreply@github.com>
Sun, 19 Mar 2017 18:20:10 +0000 (20:20 +0200)
Lib/ctypes/test/test_structures.py
Lib/test/test_atexit.py
Lib/test/test_coroutines.py
Lib/test/test_socket.py
Lib/test/test_tracemalloc.py

index 3eded7749ed95ea12f76d0be6db9c9c909cfefbe..2e778fb1b4374075f3f4a7de86da0e709dc320a2 100644 (file)
@@ -2,8 +2,8 @@ import unittest
 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):
@@ -202,7 +202,10 @@ class StructureTestCase(unittest.TestCase):
              "_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)
index 172bd25419cea73327b4dc7b6824763fc6067c48..c761076c4a0225af8c69afede54096a001ddb384 100644 (file)
@@ -143,6 +143,7 @@ class GeneralTest(unittest.TestCase):
         self.assertEqual(l, [5])
 
 
+@support.cpython_only
 class SubinterpreterTest(unittest.TestCase):
 
     def test_callbacks_leak(self):
index a69583b5f95ae69a1763e79acd9fdcd721f15bce..2b79a17ea703f53897af6a60a89f6d2e00f3f4d6 100644 (file)
@@ -2117,6 +2117,7 @@ class SysSetCoroWrapperTest(unittest.TestCase):
             sys.set_coroutine_wrapper(None)
 
 
+@support.cpython_only
 class CAPITest(unittest.TestCase):
 
     def test_tp_await_1(self):
index f8e5b369ef23b6c9d022069ab1a1d8947c28bce1..7cc2e57b0ddf74906fe49f78895a85d5bd2bb9f7 100644 (file)
@@ -906,6 +906,7 @@ class GeneralModuleTests(unittest.TestCase):
             self.assertEqual(swapped & mask, mask)
             self.assertRaises(OverflowError, func, 1<<34)
 
+    @support.cpython_only
     def testNtoHErrors(self):
         import _testcapi
         s_good_values = [0, 1, 2, 0xffff]
index 790ab7ee606d609170fba5d1c33ff6a2d559bc20..742259b4396b98607362aa94447d37e061f27047 100644 (file)
@@ -865,6 +865,7 @@ class TestCommandLine(unittest.TestCase):
                                   b'number of frames',
                                   stderr)
 
+    @unittest.skipIf(_testcapi is None, 'need _testcapi')
     def test_pymem_alloc0(self):
         # Issue #21639: Check that PyMem_Malloc(0) with tracemalloc enabled
         # does not crash.