bpo-29845: Mark tests that use _testcapi as CPython-only (#711) (#725)
(cherry picked from commit 24c738a9e91b8f46da6166663d8ce7ec18cec784)
diff --git a/Lib/test/test_atexit.py b/Lib/test/test_atexit.py
index 172bd25..c761076 100644
--- a/Lib/test/test_atexit.py
+++ b/Lib/test/test_atexit.py
@@ -143,6 +143,7 @@
self.assertEqual(l, [5])
+@support.cpython_only
class SubinterpreterTest(unittest.TestCase):
def test_callbacks_leak(self):
diff --git a/Lib/test/test_coroutines.py b/Lib/test/test_coroutines.py
index a69583b..2b79a17 100644
--- a/Lib/test/test_coroutines.py
+++ b/Lib/test/test_coroutines.py
@@ -2117,6 +2117,7 @@
sys.set_coroutine_wrapper(None)
+@support.cpython_only
class CAPITest(unittest.TestCase):
def test_tp_await_1(self):
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
index 1508f20..2497e47 100644
--- a/Lib/test/test_socket.py
+++ b/Lib/test/test_socket.py
@@ -906,6 +906,7 @@
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 ]
diff --git a/Lib/test/test_tracemalloc.py b/Lib/test/test_tracemalloc.py
index 790ab7e..742259b 100644
--- a/Lib/test/test_tracemalloc.py
+++ b/Lib/test/test_tracemalloc.py
@@ -865,6 +865,7 @@
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.