Skip to content

Commit 3e97518

Browse files
author
Yury Selivanov
authored
bpo-32273: Move asyncio.test_utils to test.test_asyncio (#4785)
1 parent 9edad3c commit 3e97518

17 files changed

Lines changed: 29 additions & 61 deletions

Lib/test/test_asyncio/test_base_events.py

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,9 @@
1414
import asyncio
1515
from asyncio import base_events
1616
from asyncio import constants
17-
from asyncio import test_utils
18-
try:
19-
from test import support
20-
except ImportError:
21-
from asyncio import test_support as support
22-
try:
23-
from test.support.script_helper import assert_python_ok
24-
except ImportError:
25-
try:
26-
from test.script_helper import assert_python_ok
27-
except ImportError:
28-
from asyncio.test_support import assert_python_ok
17+
from test.test_asyncio import utils as test_utils
18+
from test import support
19+
from test.support.script_helper import assert_python_ok
2920

3021

3122
MOCK_ANY = mock.ANY

Lib/test/test_asyncio/test_events.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import collections.abc
44
import concurrent.futures
55
import functools
6-
import gc
76
import io
87
import os
98
import platform
@@ -30,8 +29,7 @@
3029
from asyncio import coroutines
3130
from asyncio import proactor_events
3231
from asyncio import selector_events
33-
from asyncio import sslproto
34-
from asyncio import test_utils
32+
from test.test_asyncio import utils as test_utils
3533
try:
3634
from test import support
3735
except ImportError:

Lib/test/test_asyncio/test_futures.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,9 @@
99
from unittest import mock
1010

1111
import asyncio
12-
from asyncio import test_utils
1312
from asyncio import futures
14-
try:
15-
from test import support
16-
except ImportError:
17-
from asyncio import test_support as support
13+
from test.test_asyncio import utils as test_utils
14+
from test import support
1815

1916

2017
def _fakefunc(f):

Lib/test/test_asyncio/test_locks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import re
66

77
import asyncio
8-
from asyncio import test_utils
8+
from test.test_asyncio import utils as test_utils
99

1010
STR_RGX_REPR = (
1111
r'^<(?P<class>.*?) object at (?P<address>.*?)'

Lib/test/test_asyncio/test_pep492.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,11 @@
33
import types
44
import unittest
55

6-
try:
7-
from test import support
8-
except ImportError:
9-
from asyncio import test_support as support
6+
from test import support
107
from unittest import mock
118

129
import asyncio
13-
from asyncio import test_utils
10+
from test.test_asyncio import utils as test_utils
1411

1512

1613
class BaseTest(test_utils.TestCase):

Lib/test/test_asyncio/test_proactor_events.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from asyncio.proactor_events import _ProactorSocketTransport
1010
from asyncio.proactor_events import _ProactorWritePipeTransport
1111
from asyncio.proactor_events import _ProactorDuplexPipeTransport
12-
from asyncio import test_utils
12+
from test.test_asyncio import utils as test_utils
1313

1414

1515
def close_transport(transport):

Lib/test/test_asyncio/test_queues.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from unittest import mock
55

66
import asyncio
7-
from asyncio import test_utils
7+
from test.test_asyncio import utils as test_utils
88

99

1010
class _QueueTestBase(test_utils.TestCase):

Lib/test/test_asyncio/test_selector_events.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
ssl = None
1212

1313
import asyncio
14-
from asyncio import test_utils
1514
from asyncio.selector_events import BaseSelectorEventLoop
1615
from asyncio.selector_events import _SelectorTransport
1716
from asyncio.selector_events import _SelectorSocketTransport
1817
from asyncio.selector_events import _SelectorDatagramTransport
18+
from test.test_asyncio import utils as test_utils
1919

2020

2121
MOCK_ANY = mock.ANY

Lib/test/test_asyncio/test_sslproto.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import asyncio
1212
from asyncio import log
1313
from asyncio import sslproto
14-
from asyncio import test_utils
14+
from test.test_asyncio import utils as test_utils
1515

1616

1717
@unittest.skipIf(ssl is None, 'No ssl module')

Lib/test/test_asyncio/test_streams.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
ssl = None
1717

1818
import asyncio
19-
from asyncio import test_utils
19+
from test.test_asyncio import utils as test_utils
2020

2121

2222
class StreamReaderTests(test_utils.TestCase):

0 commit comments

Comments
 (0)