summaryrefslogtreecommitdiff
path: root/Lib/test/test_collections.py
diff options
context:
space:
mode:
authorYury Selivanov <yselivanov@sprymix.com>2015-07-03 13:11:54 -0400
committerYury Selivanov <yselivanov@sprymix.com>2015-07-03 13:11:54 -0400
commitd48fb485d9d6597b1048f6131a28cb14979349af (patch)
treec5937eb56fc234ac626c58f7bf7e925aef09ffe0 /Lib/test/test_collections.py
parent11e6d79eca724697f096ba465046c8ea4f8cf86d (diff)
parentfdbeb2b4b67e1e44c96127a06cf1bdf878f4f7ca (diff)
downloadcpython-git-d48fb485d9d6597b1048f6131a28cb14979349af.tar.gz
Merge 3.5 (Issue #24400)
Diffstat (limited to 'Lib/test/test_collections.py')
-rw-r--r--Lib/test/test_collections.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/Lib/test/test_collections.py b/Lib/test/test_collections.py
index 698805d4db..07420c6907 100644
--- a/Lib/test/test_collections.py
+++ b/Lib/test/test_collections.py
@@ -511,8 +511,10 @@ class TestOneTrickPonyABCs(ABCTestCase):
self.assertTrue(issubclass(type(x), Awaitable))
c = coro()
- self.assertIsInstance(c, Awaitable)
- c.close() # awoid RuntimeWarning that coro() was not awaited
+ # Iterable coroutines (generators with CO_ITERABLE_COROUTINE
+ # flag don't have '__await__' method, hence can't be instances
+ # of Awaitable. Use inspect.isawaitable to detect them.
+ self.assertNotIsInstance(c, Awaitable)
c = new_coro()
self.assertIsInstance(c, Awaitable)
@@ -559,8 +561,10 @@ class TestOneTrickPonyABCs(ABCTestCase):
self.assertTrue(issubclass(type(x), Awaitable))
c = coro()
- self.assertIsInstance(c, Coroutine)
- c.close() # awoid RuntimeWarning that coro() was not awaited
+ # Iterable coroutines (generators with CO_ITERABLE_COROUTINE
+ # flag don't have '__await__' method, hence can't be instances
+ # of Coroutine. Use inspect.isawaitable to detect them.
+ self.assertNotIsInstance(c, Coroutine)
c = new_coro()
self.assertIsInstance(c, Coroutine)