diff options
author | Yury Selivanov <yselivanov@sprymix.com> | 2016-03-02 16:31:06 (GMT) |
---|---|---|
committer | Yury Selivanov <yselivanov@sprymix.com> | 2016-03-02 16:31:06 (GMT) |
commit | d2dc15b26b03c03df664641fce544efa05588945 (patch) | |
tree | 1c30c4931ee089b9c8049224e20e3422136556cf /Lib | |
parent | 5604446b3b0b127755aa93f13c49830eba43285d (diff) | |
parent | c724bae51cd0580cd493f319f3b14c2e1a28f3b6 (diff) | |
download | cpython-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.py | 18 |
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): |