From a6a4dc816d68df04a7d592e0b6af8c7ecc4d4344 Mon Sep 17 00:00:00 2001 From: Antoine Pitrou Date: Thu, 7 Sep 2017 18:56:24 +0200 Subject: bpo-31370: Remove support for threads-less builds (#3385) * Remove Setup.config * Always define WITH_THREAD for compatibility. --- Lib/test/test_capi.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'Lib/test/test_capi.py') diff --git a/Lib/test/test_capi.py b/Lib/test/test_capi.py index c3a04b49df..1b826ee8d9 100644 --- a/Lib/test/test_capi.py +++ b/Lib/test/test_capi.py @@ -11,6 +11,7 @@ import subprocess import sys import sysconfig import textwrap +import threading import time import unittest from test import support @@ -20,10 +21,7 @@ try: import _posixsubprocess except ImportError: _posixsubprocess = None -try: - import threading -except ImportError: - threading = None + # Skip this test if the _testcapi module isn't available. _testcapi = support.import_module('_testcapi') @@ -52,7 +50,6 @@ class CAPITest(unittest.TestCase): self.assertEqual(testfunction.attribute, "test") self.assertRaises(AttributeError, setattr, inst.testfunction, "attribute", "test") - @unittest.skipUnless(threading, 'Threading required for this test.') def test_no_FatalError_infinite_loop(self): with support.SuppressCrashReport(): p = subprocess.Popen([sys.executable, "-c", @@ -276,7 +273,6 @@ class CAPITest(unittest.TestCase): self.assertIn(b'MemoryError 3 30', out) -@unittest.skipUnless(threading, 'Threading required for this test.') class TestPendingCalls(unittest.TestCase): def pendingcalls_submit(self, l, n): @@ -685,7 +681,6 @@ class SkipitemTest(unittest.TestCase): parse((1,), {}, 'O|OO', ['', 'a', '']) -@unittest.skipUnless(threading, 'Threading required for this test.') class TestThreadState(unittest.TestCase): @support.reap_threads @@ -762,7 +757,6 @@ class PyMemDebugTests(unittest.TestCase): regex = regex.format(ptr=self.PTR_REGEX) self.assertRegex(out, regex) - @unittest.skipUnless(threading, 'Test requires a GIL (multithreading)') def check_malloc_without_gil(self, code): out = self.check(code) expected = ('Fatal Python error: Python memory allocator called ' -- cgit v1.2.1