]> granicus.if.org Git - python/commitdiff
bpo-29845: Mark tests that use _testcapi as CPython-only (#711) (#726)
authorSerhiy Storchaka <storchaka@gmail.com>
Sun, 19 Mar 2017 19:38:53 +0000 (21:38 +0200)
committerGitHub <noreply@github.com>
Sun, 19 Mar 2017 19:38:53 +0000 (21:38 +0200)
(cherry picked from commit 24c738a9e91b8f46da6166663d8ce7ec18cec784)

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 0b9391a4dbb5a76f04f2d3b751a618eadec81d19..2e9fc7c49cc4998f87de37d31d38dbdb50dc6dba 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 6d63cdb5f0fcc929009b9c4eaddbe9a8e2d7d584..402fbe845765e51875d13b6fed06d62253b3d695 100644 (file)
@@ -1772,6 +1772,7 @@ class SysSetCoroWrapperTest(unittest.TestCase):
             sys.set_coroutine_wrapper(None)
 
 
+@support.cpython_only
 class CAPITest(unittest.TestCase):
 
     def test_tp_await_1(self):
index 70c03f9c468a2155ac6f76f978f58e7fcf3f0b30..b72fc8fbf0cadd3b48cbd7c64a70586dccb46834 100644 (file)
@@ -876,6 +876,7 @@ class GeneralModuleTests(unittest.TestCase):
             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 ]
index da89a9a87159358097642b389cdf202559844faa..2d1a9b3cfb20af7840177c2bb684fa0df339ca55 100644 (file)
@@ -809,6 +809,7 @@ class TestCommandLine(unittest.TestCase):
                                   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.