[Python-checkins] cpython (merge 3.5 -> 3.6): Issue #28482: Skip a few test_typing tests if asyncio unavailable (3.5->3.6)
guido.van.rossum
python-checkins at python.org
Fri Oct 21 19:13:31 EDT 2016
https://hg.python.org/cpython/rev/8f3b4779afaf
changeset: 104634:8f3b4779afaf
branch: 3.6
parent: 104630:99941cacfc38
parent: 104633:c3363f684a2d
user: Guido van Rossum <guido at python.org>
date: Fri Oct 21 16:12:50 2016 -0700
summary:
Issue #28482: Skip a few test_typing tests if asyncio unavailable (3.5->3.6)
files:
Lib/test/test_typing.py | 17 ++++++++++-------
1 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py
--- a/Lib/test/test_typing.py
+++ b/Lib/test/test_typing.py
@@ -1116,9 +1116,9 @@
blah()
-PY35 = sys.version_info[:2] >= (3, 5)
+ASYNCIO = sys.version_info[:2] >= (3, 5)
-PY35_TESTS = """
+ASYNCIO_TESTS = """
import asyncio
T_a = TypeVar('T')
@@ -1149,8 +1149,11 @@
raise StopAsyncIteration
"""
-if PY35:
- exec(PY35_TESTS)
+if ASYNCIO:
+ try:
+ exec(ASYNCIO_TESTS)
+ except ImportError:
+ ASYNCIO = False
PY36 = sys.version_info[:2] >= (3, 6)
@@ -1253,7 +1256,7 @@
self.assertIsInstance(it, typing.Iterator)
self.assertNotIsInstance(42, typing.Iterator)
- @skipUnless(PY35, 'Python 3.5 required')
+ @skipUnless(ASYNCIO, 'Python 3.5 and multithreading required')
def test_awaitable(self):
ns = {}
exec(
@@ -1266,7 +1269,7 @@
self.assertNotIsInstance(foo, typing.Awaitable)
g.send(None) # Run foo() till completion, to avoid warning.
- @skipUnless(PY35, 'Python 3.5 required')
+ @skipUnless(ASYNCIO, 'Python 3.5 and multithreading required')
def test_async_iterable(self):
base_it = range(10) # type: Iterator[int]
it = AsyncIteratorWrapper(base_it)
@@ -1274,7 +1277,7 @@
self.assertIsInstance(it, typing.AsyncIterable)
self.assertNotIsInstance(42, typing.AsyncIterable)
- @skipUnless(PY35, 'Python 3.5 required')
+ @skipUnless(ASYNCIO, 'Python 3.5 and multithreading required')
def test_async_iterator(self):
base_it = range(10) # type: Iterator[int]
it = AsyncIteratorWrapper(base_it)
--
Repository URL: https://hg.python.org/cpython
More information about the Python-checkins
mailing list