diff options
author | Martin Panter <vadmium+py@gmail.com> | 2016-10-20 22:36:18 +0000 |
---|---|---|
committer | Martin Panter <vadmium+py@gmail.com> | 2016-10-20 22:36:18 +0000 |
commit | ea8762cae64813788633b7d2a93c2c513c01fdea (patch) | |
tree | 2afdb63d2adc9cf29fec4a7a4bb1dbffc9b654df | |
parent | dc5061fe10221fa7d83c4c7cd00f4f5fa2123dd0 (diff) | |
parent | 56b2cf5e8564c7221a42675d35aaa0d0c503365e (diff) | |
download | cpython-git-ea8762cae64813788633b7d2a93c2c513c01fdea.tar.gz |
Merge test suite fixes from 3.6
-rw-r--r-- | Lib/test/test_capi.py | 1 | ||||
-rw-r--r-- | Lib/test/test_regrtest.py | 7 | ||||
-rw-r--r-- | Lib/test/test_socket.py | 1 |
3 files changed, 8 insertions, 1 deletions
diff --git a/Lib/test/test_capi.py b/Lib/test/test_capi.py index 5521e76112..d4faeb375e 100644 --- a/Lib/test/test_capi.py +++ b/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 ' diff --git a/Lib/test/test_regrtest.py b/Lib/test/test_regrtest.py index d43160470f..52909d833e 100644 --- a/Lib/test/test_regrtest.py +++ b/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: diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py index 01d0bb9eac..53ace04e4f 100644 --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -4569,6 +4569,7 @@ class TestExceptions(unittest.TestCase): sock = socket.socket( socket.AF_INET, socket.SOCK_STREAM, 0, sock0.fileno()) sock0.close() + self.addCleanup(sock.detach) with self.assertRaises(OSError): sock.setblocking(False) |