mirror of
https://github.com/python/cpython.git
synced 2025-01-24 18:13:57 +08:00
Merge test suite fixes from 3.6
This commit is contained in:
commit
ea8762cae6
@ -630,6 +630,7 @@ class PyMemDebugTests(unittest.TestCase):
|
|||||||
regex = regex.format(ptr=self.PTR_REGEX)
|
regex = regex.format(ptr=self.PTR_REGEX)
|
||||||
self.assertRegex(out, regex)
|
self.assertRegex(out, regex)
|
||||||
|
|
||||||
|
@unittest.skipUnless(threading, 'Test requires a GIL (multithreading)')
|
||||||
def check_malloc_without_gil(self, code):
|
def check_malloc_without_gil(self, code):
|
||||||
out = self.check(code)
|
out = self.check(code)
|
||||||
expected = ('Fatal Python error: Python memory allocator called '
|
expected = ('Fatal Python error: Python memory allocator called '
|
||||||
|
@ -696,7 +696,12 @@ class ArgsTestCase(BaseTestCase):
|
|||||||
code = TEST_INTERRUPTED
|
code = TEST_INTERRUPTED
|
||||||
test = self.create_test("sigint", code=code)
|
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:
|
if multiprocessing:
|
||||||
args = ("--slowest", "-j2", test)
|
args = ("--slowest", "-j2", test)
|
||||||
else:
|
else:
|
||||||
|
@ -4569,6 +4569,7 @@ class TestExceptions(unittest.TestCase):
|
|||||||
sock = socket.socket(
|
sock = socket.socket(
|
||||||
socket.AF_INET, socket.SOCK_STREAM, 0, sock0.fileno())
|
socket.AF_INET, socket.SOCK_STREAM, 0, sock0.fileno())
|
||||||
sock0.close()
|
sock0.close()
|
||||||
|
self.addCleanup(sock.detach)
|
||||||
|
|
||||||
with self.assertRaises(OSError):
|
with self.assertRaises(OSError):
|
||||||
sock.setblocking(False)
|
sock.setblocking(False)
|
||||||
|
Loading…
Reference in New Issue
Block a user