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 '
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: