diff options
author | Zsolt Dollenstein <zsol.zsol@gmail.com> | 2018-04-27 15:58:56 (GMT) |
---|---|---|
committer | Yury Selivanov <yury@magic.io> | 2018-04-27 15:58:56 (GMT) |
commit | e2396506606115e785c94ec129eb86e2ed0aa744 (patch) | |
tree | ceee4cab03aeb3f211ffbc7039fc16981be15e40 /Lib/test/test_coroutines.py | |
parent | 078c4e3519deeef8014541925da057bb064eb5a8 (diff) | |
download | cpython-e2396506606115e785c94ec129eb86e2ed0aa744.zip cpython-e2396506606115e785c94ec129eb86e2ed0aa744.tar.gz cpython-e2396506606115e785c94ec129eb86e2ed0aa744.tar.bz2 |
bpo-33363: raise SyntaxError for async for/with outside async functions (#6616)
Diffstat (limited to 'Lib/test/test_coroutines.py')
-rw-r--r-- | Lib/test/test_coroutines.py | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/Lib/test/test_coroutines.py b/Lib/test/test_coroutines.py index 10f7cca..47753e2 100644 --- a/Lib/test/test_coroutines.py +++ b/Lib/test/test_coroutines.py @@ -362,7 +362,22 @@ class AsyncBadSyntaxTest(unittest.TestCase): """def foo(): async def bar(): pass\nawait a - """] + """, + """def foo(): + async for i in arange(2): + pass + """, + """def foo(): + async with resource: + pass + """, + """async with resource: + pass + """, + """async for i in arange(2): + pass + """, + ] for code in samples: with self.subTest(code=code), self.assertRaises(SyntaxError): |