Browse Source

Issue #28484: Skip tests if GIL is not used or multithreading is disabled

pull/9921/head
Martin Panter 9 years ago
parent
commit
56b2cf5e85
  1. 1
      Lib/test/test_capi.py
  2. 7
      Lib/test/test_regrtest.py

1
Lib/test/test_capi.py

@ -630,6 +630,7 @@ 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 '

7
Lib/test/test_regrtest.py

@ -696,7 +696,12 @@ class ArgsTestCase(BaseTestCase):
code = TEST_INTERRUPTED
test = self.create_test("sigint", code=code)
for multiprocessing in (False, True):
try:
import threading
tests = (False, True)
except ImportError:
tests = (False,)
for multiprocessing in tests:
if multiprocessing:
args = ("--slowest", "-j2", test)
else:

Loading…
Cancel
Save