summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Lib/test/test_asyncio/test_base_events.py15
-rw-r--r--Lib/test/test_asyncio/test_events.py4
-rw-r--r--Lib/test/test_asyncio/test_futures.py7
-rw-r--r--Lib/test/test_asyncio/test_locks.py2
-rw-r--r--Lib/test/test_asyncio/test_pep492.py7
-rw-r--r--Lib/test/test_asyncio/test_proactor_events.py2
-rw-r--r--Lib/test/test_asyncio/test_queues.py2
-rw-r--r--Lib/test/test_asyncio/test_selector_events.py2
-rw-r--r--Lib/test/test_asyncio/test_sslproto.py2
-rw-r--r--Lib/test/test_asyncio/test_streams.py2
-rw-r--r--Lib/test/test_asyncio/test_subprocess.py8
-rw-r--r--Lib/test/test_asyncio/test_tasks.py15
-rw-r--r--Lib/test/test_asyncio/test_unix_events.py2
-rw-r--r--Lib/test/test_asyncio/test_windows_events.py2
-rw-r--r--Lib/test/test_asyncio/test_windows_utils.py7
-rw-r--r--Lib/test/test_asyncio/utils.py (renamed from Lib/asyncio/test_utils.py)10
-rw-r--r--Misc/NEWS.d/next/Library/2017-12-10-19-14-55.bpo-32273.5KKlCv.rst1
17 files changed, 29 insertions, 61 deletions
diff --git a/Lib/test/test_asyncio/test_base_events.py b/Lib/test/test_asyncio/test_base_events.py
index 6561a9df77..8b08ed1663 100644
--- a/Lib/test/test_asyncio/test_base_events.py
+++ b/Lib/test/test_asyncio/test_base_events.py
@@ -14,18 +14,9 @@ from unittest import mock
import asyncio
from asyncio import base_events
from asyncio import constants
-from asyncio import test_utils
-try:
- from test import support
-except ImportError:
- from asyncio import test_support as support
-try:
- from test.support.script_helper import assert_python_ok
-except ImportError:
- try:
- from test.script_helper import assert_python_ok
- except ImportError:
- from asyncio.test_support import assert_python_ok
+from test.test_asyncio import utils as test_utils
+from test import support
+from test.support.script_helper import assert_python_ok
MOCK_ANY = mock.ANY
diff --git a/Lib/test/test_asyncio/test_events.py b/Lib/test/test_asyncio/test_events.py
index 01300246fd..39d5bb54a9 100644
--- a/Lib/test/test_asyncio/test_events.py
+++ b/Lib/test/test_asyncio/test_events.py
@@ -3,7 +3,6 @@
import collections.abc
import concurrent.futures
import functools
-import gc
import io
import os
import platform
@@ -30,8 +29,7 @@ import asyncio
from asyncio import coroutines
from asyncio import proactor_events
from asyncio import selector_events
-from asyncio import sslproto
-from asyncio import test_utils
+from test.test_asyncio import utils as test_utils
try:
from test import support
except ImportError:
diff --git a/Lib/test/test_asyncio/test_futures.py b/Lib/test/test_asyncio/test_futures.py
index 4320a901f4..444d1df02b 100644
--- a/Lib/test/test_asyncio/test_futures.py
+++ b/Lib/test/test_asyncio/test_futures.py
@@ -9,12 +9,9 @@ import unittest
from unittest import mock
import asyncio
-from asyncio import test_utils
from asyncio import futures
-try:
- from test import support
-except ImportError:
- from asyncio import test_support as support
+from test.test_asyncio import utils as test_utils
+from test import support
def _fakefunc(f):
diff --git a/Lib/test/test_asyncio/test_locks.py b/Lib/test/test_asyncio/test_locks.py
index 78d80ecf4f..3c5069778b 100644
--- a/Lib/test/test_asyncio/test_locks.py
+++ b/Lib/test/test_asyncio/test_locks.py
@@ -5,7 +5,7 @@ from unittest import mock
import re
import asyncio
-from asyncio import test_utils
+from test.test_asyncio import utils as test_utils
STR_RGX_REPR = (
r'^<(?P<class>.*?) object at (?P<address>.*?)'
diff --git a/Lib/test/test_asyncio/test_pep492.py b/Lib/test/test_asyncio/test_pep492.py
index 442577017d..8dd0c25e7c 100644
--- a/Lib/test/test_asyncio/test_pep492.py
+++ b/Lib/test/test_asyncio/test_pep492.py
@@ -3,14 +3,11 @@
import types
import unittest
-try:
- from test import support
-except ImportError:
- from asyncio import test_support as support
+from test import support
from unittest import mock
import asyncio
-from asyncio import test_utils
+from test.test_asyncio import utils as test_utils
class BaseTest(test_utils.TestCase):
diff --git a/Lib/test/test_asyncio/test_proactor_events.py b/Lib/test/test_asyncio/test_proactor_events.py
index def08b96ab..7ccc6814b2 100644
--- a/Lib/test/test_asyncio/test_proactor_events.py
+++ b/Lib/test/test_asyncio/test_proactor_events.py
@@ -9,7 +9,7 @@ from asyncio.proactor_events import BaseProactorEventLoop
from asyncio.proactor_events import _ProactorSocketTransport
from asyncio.proactor_events import _ProactorWritePipeTransport
from asyncio.proactor_events import _ProactorDuplexPipeTransport
-from asyncio import test_utils
+from test.test_asyncio import utils as test_utils
def close_transport(transport):
diff --git a/Lib/test/test_asyncio/test_queues.py b/Lib/test/test_asyncio/test_queues.py
index 3b66d616f8..8d78546318 100644
--- a/Lib/test/test_asyncio/test_queues.py
+++ b/Lib/test/test_asyncio/test_queues.py
@@ -4,7 +4,7 @@ import unittest
from unittest import mock
import asyncio
-from asyncio import test_utils
+from test.test_asyncio import utils as test_utils
class _QueueTestBase(test_utils.TestCase):
diff --git a/Lib/test/test_asyncio/test_selector_events.py b/Lib/test/test_asyncio/test_selector_events.py
index 616eb6f263..24feb30e3d 100644
--- a/Lib/test/test_asyncio/test_selector_events.py
+++ b/Lib/test/test_asyncio/test_selector_events.py
@@ -11,11 +11,11 @@ except ImportError:
ssl = None
import asyncio
-from asyncio import test_utils
from asyncio.selector_events import BaseSelectorEventLoop
from asyncio.selector_events import _SelectorTransport
from asyncio.selector_events import _SelectorSocketTransport
from asyncio.selector_events import _SelectorDatagramTransport
+from test.test_asyncio import utils as test_utils
MOCK_ANY = mock.ANY
diff --git a/Lib/test/test_asyncio/test_sslproto.py b/Lib/test/test_asyncio/test_sslproto.py
index f573ae8fe7..7650fe6bd4 100644
--- a/Lib/test/test_asyncio/test_sslproto.py
+++ b/Lib/test/test_asyncio/test_sslproto.py
@@ -11,7 +11,7 @@ except ImportError:
import asyncio
from asyncio import log
from asyncio import sslproto
-from asyncio import test_utils
+from test.test_asyncio import utils as test_utils
@unittest.skipIf(ssl is None, 'No ssl module')
diff --git a/Lib/test/test_asyncio/test_streams.py b/Lib/test/test_asyncio/test_streams.py
index 1927d73128..7a0762cfa3 100644
--- a/Lib/test/test_asyncio/test_streams.py
+++ b/Lib/test/test_asyncio/test_streams.py
@@ -16,7 +16,7 @@ except ImportError:
ssl = None
import asyncio
-from asyncio import test_utils
+from test.test_asyncio import utils as test_utils
class StreamReaderTests(test_utils.TestCase):
diff --git a/Lib/test/test_asyncio/test_subprocess.py b/Lib/test/test_asyncio/test_subprocess.py
index ad4bb14955..81b08d6c29 100644
--- a/Lib/test/test_asyncio/test_subprocess.py
+++ b/Lib/test/test_asyncio/test_subprocess.py
@@ -7,11 +7,9 @@ from unittest import mock
import asyncio
from asyncio import base_subprocess
from asyncio import subprocess
-from asyncio import test_utils
-try:
- from test import support
-except ImportError:
- from asyncio import test_support as support
+from test.test_asyncio import utils as test_utils
+from test import support
+
if sys.platform != 'win32':
from asyncio import unix_events
diff --git a/Lib/test/test_asyncio/test_tasks.py b/Lib/test/test_asyncio/test_tasks.py
index cdc882a9be..071481dbc2 100644
--- a/Lib/test/test_asyncio/test_tasks.py
+++ b/Lib/test/test_asyncio/test_tasks.py
@@ -17,18 +17,9 @@ import asyncio
from asyncio import coroutines
from asyncio import futures
from asyncio import tasks
-from asyncio import test_utils
-try:
- from test import support
-except ImportError:
- from asyncio import test_support as support
-try:
- from test.support.script_helper import assert_python_ok
-except ImportError:
- try:
- from test.script_helper import assert_python_ok
- except ImportError:
- from asyncio.test_support import assert_python_ok
+from test.test_asyncio import utils as test_utils
+from test import support
+from test.support.script_helper import assert_python_ok
@asyncio.coroutine
diff --git a/Lib/test/test_asyncio/test_unix_events.py b/Lib/test/test_asyncio/test_unix_events.py
index 6746b34fe2..e13cc3749d 100644
--- a/Lib/test/test_asyncio/test_unix_events.py
+++ b/Lib/test/test_asyncio/test_unix_events.py
@@ -21,8 +21,8 @@ if sys.platform == 'win32':
import asyncio
from asyncio import log
-from asyncio import test_utils
from asyncio import unix_events
+from test.test_asyncio import utils as test_utils
MOCK_ANY = mock.ANY
diff --git a/Lib/test/test_asyncio/test_windows_events.py b/Lib/test/test_asyncio/test_windows_events.py
index de6fe12061..fdba636f20 100644
--- a/Lib/test/test_asyncio/test_windows_events.py
+++ b/Lib/test/test_asyncio/test_windows_events.py
@@ -11,8 +11,8 @@ import _overlapped
import _winapi
import asyncio
-from asyncio import test_utils
from asyncio import windows_events
+from test.test_asyncio import utils as test_utils
class UpperProto(asyncio.Protocol):
diff --git a/Lib/test/test_asyncio/test_windows_utils.py b/Lib/test/test_asyncio/test_windows_utils.py
index 952f95e573..9fc38586ab 100644
--- a/Lib/test/test_asyncio/test_windows_utils.py
+++ b/Lib/test/test_asyncio/test_windows_utils.py
@@ -1,10 +1,8 @@
"""Tests for window_utils"""
-import socket
import sys
import unittest
import warnings
-from unittest import mock
if sys.platform != 'win32':
raise unittest.SkipTest('Windows only')
@@ -13,10 +11,7 @@ import _overlapped
import _winapi
from asyncio import windows_utils
-try:
- from test import support
-except ImportError:
- from asyncio import test_support as support
+from test import support
class PipeTests(unittest.TestCase):
diff --git a/Lib/asyncio/test_utils.py b/Lib/test/test_asyncio/utils.py
index 231916970c..560db9f562 100644
--- a/Lib/asyncio/test_utils.py
+++ b/Lib/test/test_asyncio/utils.py
@@ -26,11 +26,11 @@ try:
except ImportError: # pragma: no cover
ssl = None
-from . import base_events
-from . import events
-from . import futures
-from . import tasks
-from .log import logger
+from asyncio import base_events
+from asyncio import events
+from asyncio import futures
+from asyncio import tasks
+from asyncio.log import logger
from test import support
diff --git a/Misc/NEWS.d/next/Library/2017-12-10-19-14-55.bpo-32273.5KKlCv.rst b/Misc/NEWS.d/next/Library/2017-12-10-19-14-55.bpo-32273.5KKlCv.rst
new file mode 100644
index 0000000000..3bbec8f6e3
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2017-12-10-19-14-55.bpo-32273.5KKlCv.rst
@@ -0,0 +1 @@
+Move asyncio.test_utils to test.test_asyncio.