summaryrefslogtreecommitdiff
path: root/tests/test_windows_utils.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-12-18 12:28:08 +0100
committerVictor Stinner <victor.stinner@gmail.com>2014-12-18 12:28:08 +0100
commit1d83d4acc472135551675fa1a33322afaf8a4093 (patch)
tree927f9a2c8cc435fd5e2d08eb3c3176a3e068f770 /tests/test_windows_utils.py
parent6f9e5fb7db35ebc8e4e5e80431d517d55d3320f8 (diff)
downloadtrollius-git-1d83d4acc472135551675fa1a33322afaf8a4093.tar.gz
Copy a subset of test.support from CPython 3.5 to no more depend on the test
module to run the asyncio test suite. The test module is rarely installed.
Diffstat (limited to 'tests/test_windows_utils.py')
-rw-r--r--tests/test_windows_utils.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/test_windows_utils.py b/tests/test_windows_utils.py
index 3e7a211..b957949 100644
--- a/tests/test_windows_utils.py
+++ b/tests/test_windows_utils.py
@@ -2,11 +2,14 @@
import socket
import sys
-import test.support
import unittest
-from test.support import IPV6_ENABLED
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')
@@ -28,7 +31,7 @@ class WinsocketpairTests(unittest.TestCase):
ssock, csock = windows_utils.socketpair()
self.check_winsocketpair(ssock, csock)
- @unittest.skipUnless(IPV6_ENABLED, 'IPv6 not supported or enabled')
+ @unittest.skipUnless(support.IPV6_ENABLED, 'IPv6 not supported or enabled')
def test_winsocketpair_ipv6(self):
ssock, csock = windows_utils.socketpair(family=socket.AF_INET6)
self.check_winsocketpair(ssock, csock)
@@ -114,7 +117,7 @@ class PipeTests(unittest.TestCase):
# check garbage collection of p closes handle
del p
- test.support.gc_collect()
+ support.gc_collect()
try:
_winapi.CloseHandle(h)
except OSError as e: