summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asyncio/test_streams.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_asyncio/test_streams.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_asyncio/test_streams.py')
-rw-r--r--Lib/test/test_asyncio/test_streams.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/test/test_asyncio/test_streams.py b/Lib/test/test_asyncio/test_streams.py
index 12bd536..1e9d115 100644
--- a/Lib/test/test_asyncio/test_streams.py
+++ b/Lib/test/test_asyncio/test_streams.py
@@ -9,7 +9,7 @@ import sys
import threading
import unittest
from unittest import mock
-from test import support
+from test.support import socket_helper
try:
import ssl
except ImportError:
@@ -66,7 +66,7 @@ class StreamTests(test_utils.TestCase):
loop=self.loop)
self._basetest_open_connection(conn_fut)
- @support.skip_unless_bind_unix_socket
+ @socket_helper.skip_unless_bind_unix_socket
def test_open_unix_connection(self):
with test_utils.run_test_unix_server() as httpd:
conn_fut = asyncio.open_unix_connection(httpd.address,
@@ -99,7 +99,7 @@ class StreamTests(test_utils.TestCase):
self._basetest_open_connection_no_loop_ssl(conn_fut)
- @support.skip_unless_bind_unix_socket
+ @socket_helper.skip_unless_bind_unix_socket
@unittest.skipIf(ssl is None, 'No ssl module')
def test_open_unix_connection_no_loop_ssl(self):
with test_utils.run_test_unix_server(use_ssl=True) as httpd:
@@ -130,7 +130,7 @@ class StreamTests(test_utils.TestCase):
loop=self.loop)
self._basetest_open_connection_error(conn_fut)
- @support.skip_unless_bind_unix_socket
+ @socket_helper.skip_unless_bind_unix_socket
def test_open_unix_connection_error(self):
with test_utils.run_test_unix_server() as httpd:
conn_fut = asyncio.open_unix_connection(httpd.address,
@@ -653,7 +653,7 @@ class StreamTests(test_utils.TestCase):
self.assertEqual(messages, [])
- @support.skip_unless_bind_unix_socket
+ @socket_helper.skip_unless_bind_unix_socket
def test_start_unix_server(self):
class MyServer: