summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_support.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2020-04-25 07:06:29 (GMT)
committerGitHub <noreply@github.com>2020-04-25 07:06:29 (GMT)
commit16994912c93e8e5db7365d48b75d67d3f70dd7b2 (patch)
tree248f177a93676406af6d6ae977bed868aa2d1a34 /Lib/test/test_support.py
parent3c8a5b459d68b4337776ada1e04f5b33f90a2275 (diff)
downloadcpython-16994912c93e8e5db7365d48b75d67d3f70dd7b2.zip
cpython-16994912c93e8e5db7365d48b75d67d3f70dd7b2.tar.gz
cpython-16994912c93e8e5db7365d48b75d67d3f70dd7b2.tar.bz2
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.
Diffstat (limited to 'Lib/test/test_support.py')
-rw-r--r--Lib/test/test_support.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/Lib/test/test_support.py b/Lib/test/test_support.py
index dee1db7..606e570 100644
--- a/Lib/test/test_support.py
+++ b/Lib/test/test_support.py
@@ -14,6 +14,7 @@ import time
import unittest
from test import support
from test.support import script_helper
+from test.support import socket_helper
TESTFN = support.TESTFN
@@ -91,17 +92,17 @@ class TestSupport(unittest.TestCase):
support.rmtree('__pycache__')
def test_HOST(self):
- s = socket.create_server((support.HOST, 0))
+ s = socket.create_server((socket_helper.HOST, 0))
s.close()
def test_find_unused_port(self):
- port = support.find_unused_port()
- s = socket.create_server((support.HOST, port))
+ port = socket_helper.find_unused_port()
+ s = socket.create_server((socket_helper.HOST, port))
s.close()
def test_bind_port(self):
s = socket.socket()
- support.bind_port(s)
+ socket_helper.bind_port(s)
s.listen()
s.close()