mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-40275: Avoid importing socket in test.support (GH-19603)
* Move socket related functions from test.support to socket_helper. * Import socket, nntplib and urllib.error lazily in transient_internet(). * Remove importing multiprocess.
This commit is contained in:
parent
3c8a5b459d
commit
16994912c9
37 changed files with 472 additions and 429 deletions
|
@ -1,5 +1,6 @@
|
|||
from unittest import mock
|
||||
from test import support
|
||||
from test.support import socket_helper
|
||||
from test.test_httpservers import NoLogRequestHandler
|
||||
from unittest import TestCase
|
||||
from wsgiref.util import setup_testing_defaults
|
||||
|
@ -263,7 +264,7 @@ class IntegrationTests(TestCase):
|
|||
class WsgiHandler(NoLogRequestHandler, WSGIRequestHandler):
|
||||
pass
|
||||
|
||||
server = make_server(support.HOST, 0, app, handler_class=WsgiHandler)
|
||||
server = make_server(socket_helper.HOST, 0, app, handler_class=WsgiHandler)
|
||||
self.addCleanup(server.server_close)
|
||||
interrupted = threading.Event()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue