diff options
author | Zsolt Dollenstein <zsol.zsol@gmail.com> | 2018-04-27 22:33:37 (GMT) |
---|---|---|
committer | Yury Selivanov <yury@magic.io> | 2018-04-27 22:33:37 (GMT) |
commit | a93a663d6c2fdfbddbda9729c96e2737c0012522 (patch) | |
tree | ce34cb81abd313b5721b9edd1890da7a70185e14 /Lib/test/test_coroutines.py | |
parent | dd3ede7537653a62815c2fedbb67d6f2fb870d4c (diff) | |
download | cpython-a93a663d6c2fdfbddbda9729c96e2737c0012522.zip cpython-a93a663d6c2fdfbddbda9729c96e2737c0012522.tar.gz cpython-a93a663d6c2fdfbddbda9729c96e2737c0012522.tar.bz2 |
[3.7] bpo-33363: raise SyntaxError for async for/with outside async functions (GH-6616). (GH-6619)
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 ea54bca..ac24f39 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): |