summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorYury Selivanov <yselivanov@sprymix.com>2016-03-02 16:31:06 (GMT)
committerYury Selivanov <yselivanov@sprymix.com>2016-03-02 16:31:06 (GMT)
commitd2dc15b26b03c03df664641fce544efa05588945 (patch)
tree1c30c4931ee089b9c8049224e20e3422136556cf /Lib
parent5604446b3b0b127755aa93f13c49830eba43285d (diff)
parentc724bae51cd0580cd493f319f3b14c2e1a28f3b6 (diff)
downloadcpython-d2dc15b26b03c03df664641fce544efa05588945.zip
cpython-d2dc15b26b03c03df664641fce544efa05588945.tar.gz
cpython-d2dc15b26b03c03df664641fce544efa05588945.tar.bz2
Merge 3.5 (issue #25888)
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_coroutines.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/Lib/test/test_coroutines.py b/Lib/test/test_coroutines.py
index 954a9a1..187348d 100644
--- a/Lib/test/test_coroutines.py
+++ b/Lib/test/test_coroutines.py
@@ -942,6 +942,24 @@ class CoroutineTest(unittest.TestCase):
with self.assertRaises(Marker):
c.throw(ZeroDivisionError)
+ def test_await_15(self):
+ @types.coroutine
+ def nop():
+ yield
+
+ async def coroutine():
+ await nop()
+
+ async def waiter(coro):
+ await coro
+
+ coro = coroutine()
+ coro.send(None)
+
+ with self.assertRaisesRegex(RuntimeError,
+ "coroutine is being awaited already"):
+ waiter(coro).send(None)
+
def test_with_1(self):
class Manager:
def __init__(self, name):