diff options
Diffstat (limited to 'Lib/test')
| -rw-r--r-- | Lib/test/ssl_servers.py | 2 | ||||
| -rw-r--r-- | Lib/test/support/__init__.py | 1 | ||||
| -rw-r--r-- | Lib/test/test_httplib.py | 3 | ||||
| -rw-r--r-- | Lib/test/test_idle.py | 2 | ||||
| -rw-r--r-- | Lib/test/test_multiprocessing_main_handling.py | 3 | ||||
| -rw-r--r-- | Lib/test/test_thread.py | 2 | ||||
| -rw-r--r-- | Lib/test/test_threadsignals.py | 2 | ||||
| -rw-r--r-- | Lib/test/test_tools/test_sundry.py | 1 | ||||
| -rw-r--r-- | Lib/test/test_winreg.py | 2 | ||||
| -rw-r--r-- | Lib/test/test_wsgiref.py | 2 | ||||
| -rw-r--r-- | Lib/test/test_xmlrpc.py | 8 |
11 files changed, 9 insertions, 19 deletions
diff --git a/Lib/test/ssl_servers.py b/Lib/test/ssl_servers.py index 81464679bd..bfe533c480 100644 --- a/Lib/test/ssl_servers.py +++ b/Lib/test/ssl_servers.py @@ -2,13 +2,13 @@ import os import sys import ssl import pprint +import threading import urllib.parse # Rename HTTPServer to _HTTPServer so as to avoid confusion with HTTPSServer. from http.server import (HTTPServer as _HTTPServer, SimpleHTTPRequestHandler, BaseHTTPRequestHandler) from test import support -threading = support.import_module("threading") here = os.path.dirname(__file__) diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py index b2e45605b9..4f60507919 100644 --- a/Lib/test/support/__init__.py +++ b/Lib/test/support/__init__.py @@ -2060,7 +2060,6 @@ def threading_cleanup(*original_values): def reap_threads(func): """Use this function when threads are being used. This will ensure that the threads are cleaned up even when the test fails. - If threading is unavailable this function does nothing. """ @functools.wraps(func) def decorator(*args): diff --git a/Lib/test/test_httplib.py b/Lib/test/test_httplib.py index ab798a2525..bec994ed29 100644 --- a/Lib/test/test_httplib.py +++ b/Lib/test/test_httplib.py @@ -5,6 +5,7 @@ import itertools import os import array import socket +import threading import unittest TestCase = unittest.TestCase @@ -1077,8 +1078,6 @@ class BasicTest(TestCase): def test_response_fileno(self): # Make sure fd returned by fileno is valid. - threading = support.import_module("threading") - serv = socket.socket( socket.AF_INET, socket.SOCK_STREAM, socket.IPPROTO_TCP) self.addCleanup(serv.close) diff --git a/Lib/test/test_idle.py b/Lib/test/test_idle.py index b7ef70ddba..31fffd94a0 100644 --- a/Lib/test/test_idle.py +++ b/Lib/test/test_idle.py @@ -1,7 +1,7 @@ import unittest from test.support import import_module -# Skip test if _thread or _tkinter wasn't built, if idlelib is missing, +# Skip test if _tkinter wasn't built, if idlelib is missing, # or if tcl/tk is not the 8.5+ needed for ttk widgets. tk = import_module('tkinter') # imports _tkinter if tk.TkVersion < 8.5: diff --git a/Lib/test/test_multiprocessing_main_handling.py b/Lib/test/test_multiprocessing_main_handling.py index a9c5d69fae..fd93184914 100644 --- a/Lib/test/test_multiprocessing_main_handling.py +++ b/Lib/test/test_multiprocessing_main_handling.py @@ -1,7 +1,6 @@ # tests __main__ module handling in multiprocessing from test import support -# Skip tests if _thread or _multiprocessing wasn't built. -support.import_module('_thread') +# Skip tests if _multiprocessing wasn't built. support.import_module('_multiprocessing') import importlib diff --git a/Lib/test/test_thread.py b/Lib/test/test_thread.py index 52f6c798b8..64ffe46052 100644 --- a/Lib/test/test_thread.py +++ b/Lib/test/test_thread.py @@ -2,7 +2,7 @@ import os import unittest import random from test import support -thread = support.import_module('_thread') +import _thread as thread import time import sys import weakref diff --git a/Lib/test/test_threadsignals.py b/Lib/test/test_threadsignals.py index f93dd77255..67a1c581d7 100644 --- a/Lib/test/test_threadsignals.py +++ b/Lib/test/test_threadsignals.py @@ -5,7 +5,7 @@ import signal import os import sys from test import support -thread = support.import_module('_thread') +import _thread as thread import time if (sys.platform[:3] == 'win'): diff --git a/Lib/test/test_tools/test_sundry.py b/Lib/test/test_tools/test_sundry.py index 39e541b45b..2f9db9424f 100644 --- a/Lib/test/test_tools/test_sundry.py +++ b/Lib/test/test_tools/test_sundry.py @@ -40,7 +40,6 @@ class TestSundryScripts(unittest.TestCase): for name in self.windows_only: import_tool(name) - @unittest.skipIf(not support.threading, "test requires _thread module") def test_analyze_dxp_import(self): if hasattr(sys, 'getdxp'): import_tool('analyze_dxp') diff --git a/Lib/test/test_winreg.py b/Lib/test/test_winreg.py index 2be61ae15d..11d054e16c 100644 --- a/Lib/test/test_winreg.py +++ b/Lib/test/test_winreg.py @@ -4,7 +4,7 @@ import os, sys, errno import unittest from test import support -threading = support.import_module("threading") +import threading from platform import machine # Do this first so test will be skipped if module doesn't exist diff --git a/Lib/test/test_wsgiref.py b/Lib/test/test_wsgiref.py index 7708e20684..8422b308d7 100644 --- a/Lib/test/test_wsgiref.py +++ b/Lib/test/test_wsgiref.py @@ -18,6 +18,7 @@ import os import re import signal import sys +import threading import unittest @@ -253,7 +254,6 @@ class IntegrationTests(TestCase): # BaseHandler._write() and _flush() have to write all data, even if # it takes multiple send() calls. Test this by interrupting a send() # call with a Unix signal. - threading = support.import_module("threading") pthread_kill = support.get_attribute(signal, "pthread_kill") def app(environ, start_response): diff --git a/Lib/test/test_xmlrpc.py b/Lib/test/test_xmlrpc.py index c9099e0511..15b7ae5581 100644 --- a/Lib/test/test_xmlrpc.py +++ b/Lib/test/test_xmlrpc.py @@ -1175,13 +1175,7 @@ class GzipUtilTestCase(unittest.TestCase): class ServerProxyTestCase(unittest.TestCase): def setUp(self): unittest.TestCase.setUp(self) - if threading: - self.url = URL - else: - # Without threading, http_server() and http_multi_server() will not - # be executed and URL is still equal to None. 'http://' is a just - # enough to choose the scheme (HTTP) - self.url = 'http://' + self.url = URL def test_close(self): p = xmlrpclib.ServerProxy(self.url) |
