Commit f8418a0c authored by Victor Stinner's avatar Victor Stinner

asyncio: sync with Tulip

* Fix pyflakes warnings: remove unused imports and variables
* asyncio.test_support now uses test.support and test.script_helper if available
parent 298d0935
...@@ -14,8 +14,8 @@ from asyncio import base_events ...@@ -14,8 +14,8 @@ from asyncio import base_events
from asyncio import constants from asyncio import constants
from asyncio import test_utils from asyncio import test_utils
try: try:
from test.script_helper import assert_python_ok
from test import support from test import support
from test.script_helper import assert_python_ok
except ImportError: except ImportError:
from asyncio import test_support as support from asyncio import test_support as support
from asyncio.test_support import assert_python_ok from asyncio.test_support import assert_python_ok
......
...@@ -27,7 +27,7 @@ from asyncio import proactor_events ...@@ -27,7 +27,7 @@ from asyncio import proactor_events
from asyncio import selector_events from asyncio import selector_events
from asyncio import test_utils from asyncio import test_utils
try: try:
from test import support # find_unused_port, IPV6_ENABLED, TEST_HOME_DIR from test import support
except ImportError: except ImportError:
from asyncio import test_support as support from asyncio import test_support as support
......
...@@ -10,7 +10,7 @@ from unittest import mock ...@@ -10,7 +10,7 @@ from unittest import mock
import asyncio import asyncio
from asyncio import test_utils from asyncio import test_utils
try: try:
from test import support # gc_collect from test import support
except ImportError: except ImportError:
from asyncio import test_support as support from asyncio import test_support as support
......
"""Tests for selector_events.py""" """Tests for selector_events.py"""
import errno import errno
import gc
import pprint
import socket import socket
import sys
import unittest import unittest
from unittest import mock from unittest import mock
try: try:
......
...@@ -6,12 +6,12 @@ from unittest import mock ...@@ -6,12 +6,12 @@ from unittest import mock
import asyncio import asyncio
from asyncio import subprocess from asyncio import subprocess
from asyncio import test_utils from asyncio import test_utils
if sys.platform != 'win32':
from asyncio import unix_events
try: try:
from test import support # PIPE_MAX_SIZE from test import support
except ImportError: except ImportError:
from asyncio import test_support as support from asyncio import test_support as support
if sys.platform != 'win32':
from asyncio import unix_events
# Program blocking # Program blocking
PROGRAM_BLOCKED = [sys.executable, '-c', 'import time; time.sleep(3600)'] PROGRAM_BLOCKED = [sys.executable, '-c', 'import time; time.sleep(3600)']
......
...@@ -7,17 +7,17 @@ import types ...@@ -7,17 +7,17 @@ import types
import unittest import unittest
import weakref import weakref
from unittest import mock from unittest import mock
import asyncio
from asyncio import coroutines
from asyncio import test_utils
try: try:
from test import support # gc_collect from test import support
from test.script_helper import assert_python_ok from test.script_helper import assert_python_ok
except ImportError: except ImportError:
from asyncio import test_support as support from asyncio import test_support as support
from asyncio.test_support import assert_python_ok from asyncio.test_support import assert_python_ok
import asyncio
from asyncio import coroutines
from asyncio import test_utils
PY34 = (sys.version_info >= (3, 4)) PY34 = (sys.version_info >= (3, 4))
PY35 = (sys.version_info >= (3, 5)) PY35 = (sys.version_info >= (3, 5))
......
"""Tests for unix_events.py.""" """Tests for unix_events.py."""
import collections import collections
import gc
import errno import errno
import io import io
import os import os
import pprint
import signal import signal
import socket import socket
import stat import stat
......
...@@ -5,18 +5,17 @@ import sys ...@@ -5,18 +5,17 @@ import sys
import unittest import unittest
from unittest import mock from unittest import mock
try:
from test import support # gc_collect, IPV6_ENABLED
except ImportError:
from asyncio import test_support as support
if sys.platform != 'win32': if sys.platform != 'win32':
raise unittest.SkipTest('Windows only') raise unittest.SkipTest('Windows only')
import _winapi import _winapi
from asyncio import windows_utils
from asyncio import _overlapped from asyncio import _overlapped
from asyncio import windows_utils
try:
from test import support
except ImportError:
from asyncio import test_support as support
class WinsocketpairTests(unittest.TestCase): class WinsocketpairTests(unittest.TestCase):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment