mirror of https://github.com/python/cpython
bpo-32273: Move asyncio.test_utils to test.test_asyncio (#4785)
This commit is contained in:
parent
9edad3c701
commit
3e9751819a
|
@ -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.test_asyncio import utils as test_utils
|
||||
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
|
||||
|
||||
|
||||
MOCK_ANY = mock.ANY
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -9,12 +9,9 @@ import unittest
|
|||
from unittest import mock
|
||||
|
||||
import asyncio
|
||||
from asyncio import test_utils
|
||||
from asyncio import futures
|
||||
try:
|
||||
from test.test_asyncio import utils as test_utils
|
||||
from test import support
|
||||
except ImportError:
|
||||
from asyncio import test_support as support
|
||||
|
||||
|
||||
def _fakefunc(f):
|
||||
|
|
|
@ -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>.*?)'
|
||||
|
|
|
@ -3,14 +3,11 @@
|
|||
import types
|
||||
import unittest
|
||||
|
||||
try:
|
||||
from test import support
|
||||
except ImportError:
|
||||
from asyncio import test_support as 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):
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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')
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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.test_asyncio import utils as test_utils
|
||||
from test import support
|
||||
except ImportError:
|
||||
from asyncio import test_support as support
|
||||
|
||||
if sys.platform != 'win32':
|
||||
from asyncio import unix_events
|
||||
|
||||
|
|
|
@ -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.test_asyncio import utils as test_utils
|
||||
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
|
||||
|
||||
|
||||
@asyncio.coroutine
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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
|
||||
|
||||
|
||||
class PipeTests(unittest.TestCase):
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
@ -0,0 +1 @@
|
|||
Move asyncio.test_utils to test.test_asyncio.
|
Loading…
Reference in New Issue