From: Victor Stinner Date: Fri, 26 Dec 2014 20:16:42 +0000 (+0100) Subject: asyncio: sync with Tulip X-Git-Tag: v3.4.3rc1~191 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d7ff5a5375cc23dff10f91696ac4895971c5850c;p=thirdparty%2FPython%2Fcpython.git 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 --- diff --git a/Lib/test/test_asyncio/test_base_events.py b/Lib/test/test_asyncio/test_base_events.py index 4e5b6ca9dfcd..e8409159d51a 100644 --- a/Lib/test/test_asyncio/test_base_events.py +++ b/Lib/test/test_asyncio/test_base_events.py @@ -14,8 +14,8 @@ from asyncio import base_events from asyncio import constants from asyncio import test_utils try: - from test.script_helper import assert_python_ok from test import support + from test.script_helper import assert_python_ok except ImportError: from asyncio import test_support as support from asyncio.test_support import assert_python_ok diff --git a/Lib/test/test_asyncio/test_events.py b/Lib/test/test_asyncio/test_events.py index 063029208aef..af2da1fedbdb 100644 --- a/Lib/test/test_asyncio/test_events.py +++ b/Lib/test/test_asyncio/test_events.py @@ -27,7 +27,7 @@ from asyncio import proactor_events from asyncio import selector_events from asyncio import test_utils try: - from test import support # find_unused_port, IPV6_ENABLED, TEST_HOME_DIR + from test import support except ImportError: from asyncio import test_support as support diff --git a/Lib/test/test_asyncio/test_futures.py b/Lib/test/test_asyncio/test_futures.py index f9c3ad2086c5..286370914d9f 100644 --- a/Lib/test/test_asyncio/test_futures.py +++ b/Lib/test/test_asyncio/test_futures.py @@ -10,7 +10,7 @@ from unittest import mock import asyncio from asyncio import test_utils try: - from test import support # gc_collect + from test import support except ImportError: from asyncio import test_support as support diff --git a/Lib/test/test_asyncio/test_selector_events.py b/Lib/test/test_asyncio/test_selector_events.py index 8eba56c443b2..ff114f82901a 100644 --- a/Lib/test/test_asyncio/test_selector_events.py +++ b/Lib/test/test_asyncio/test_selector_events.py @@ -1,10 +1,7 @@ """Tests for selector_events.py""" import errno -import gc -import pprint import socket -import sys import unittest from unittest import mock try: diff --git a/Lib/test/test_asyncio/test_subprocess.py b/Lib/test/test_asyncio/test_subprocess.py index 08c8ac2450e2..55c47b5b46d8 100644 --- a/Lib/test/test_asyncio/test_subprocess.py +++ b/Lib/test/test_asyncio/test_subprocess.py @@ -6,12 +6,12 @@ from unittest import mock import asyncio from asyncio import subprocess from asyncio import test_utils -if sys.platform != 'win32': - from asyncio import unix_events try: - from test import support # PIPE_MAX_SIZE + from test import support except ImportError: from asyncio import test_support as support +if sys.platform != 'win32': + from asyncio import unix_events # Program blocking PROGRAM_BLOCKED = [sys.executable, '-c', 'import time; time.sleep(3600)'] diff --git a/Lib/test/test_asyncio/test_tasks.py b/Lib/test/test_asyncio/test_tasks.py index 25b21dc5ecf5..1520fb4cc751 100644 --- a/Lib/test/test_asyncio/test_tasks.py +++ b/Lib/test/test_asyncio/test_tasks.py @@ -7,17 +7,17 @@ import types import unittest import weakref from unittest import mock + +import asyncio +from asyncio import coroutines +from asyncio import test_utils try: - from test import support # gc_collect + from test import support from test.script_helper import assert_python_ok except ImportError: from asyncio import test_support as support 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)) PY35 = (sys.version_info >= (3, 5)) diff --git a/Lib/test/test_asyncio/test_unix_events.py b/Lib/test/test_asyncio/test_unix_events.py index b6ad0189215b..4b825dc84bd9 100644 --- a/Lib/test/test_asyncio/test_unix_events.py +++ b/Lib/test/test_asyncio/test_unix_events.py @@ -1,11 +1,9 @@ """Tests for unix_events.py.""" import collections -import gc import errno import io import os -import pprint import signal import socket import stat diff --git a/Lib/test/test_asyncio/test_windows_utils.py b/Lib/test/test_asyncio/test_windows_utils.py index b9579491844b..af5c453b0874 100644 --- a/Lib/test/test_asyncio/test_windows_utils.py +++ b/Lib/test/test_asyncio/test_windows_utils.py @@ -5,18 +5,17 @@ import sys import unittest 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': raise unittest.SkipTest('Windows only') import _winapi -from asyncio import windows_utils 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):