[Python-checkins] cpython: Make asyncio tests run on Windows.
guido.van.rossum
python-checkins at python.org
Thu Oct 17 23:23:25 CEST 2013
http://hg.python.org/cpython/rev/18c9d0b130c2
changeset: 86414:18c9d0b130c2
user: Guido van Rossum <guido at dropbox.com>
date: Thu Oct 17 14:23:17 2013 -0700
summary:
Make asyncio tests run on Windows.
files:
Lib/test/test_asyncio/test_streams.py | 5 ++++-
Lib/test/test_asyncio/test_unix_events.py | 3 +++
Lib/test/test_asyncio/test_windows_utils.py | 6 +++++-
3 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/Lib/test/test_asyncio/test_streams.py b/Lib/test/test_asyncio/test_streams.py
--- a/Lib/test/test_asyncio/test_streams.py
+++ b/Lib/test/test_asyncio/test_streams.py
@@ -1,9 +1,12 @@
"""Tests for streams.py."""
import gc
-import ssl
import unittest
import unittest.mock
+try:
+ import ssl
+except ImportError:
+ ssl = None
from asyncio import events
from asyncio import streams
diff --git a/Lib/test/test_asyncio/test_unix_events.py b/Lib/test/test_asyncio/test_unix_events.py
--- a/Lib/test/test_asyncio/test_unix_events.py
+++ b/Lib/test/test_asyncio/test_unix_events.py
@@ -10,6 +10,9 @@
import unittest
import unittest.mock
+if sys.platform == 'win32':
+ raise unittest.SkipTest('UNIX only')
+
from asyncio import events
from asyncio import futures
diff --git a/Lib/test/test_asyncio/test_windows_utils.py b/Lib/test/test_asyncio/test_windows_utils.py
--- a/Lib/test/test_asyncio/test_windows_utils.py
+++ b/Lib/test/test_asyncio/test_windows_utils.py
@@ -11,7 +11,11 @@
import _winapi
from asyncio import windows_utils
-from asyncio import _overlapped
+
+try:
+ import _overlapped
+except ImportError:
+ from asyncio import _overlapped
class WinsocketpairTests(unittest.TestCase):
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list