summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorBatuhan Taşkaya <47358913+isidentical@users.noreply.github.com>2020-03-19 11:35:44 (GMT)
committerGitHub <noreply@github.com>2020-03-19 11:35:44 (GMT)
commit9052f7a41b90f2d34011c8da68f9a4facebc8a97 (patch)
treead9b4d2fee6c56940a7a73482629ddb23342036b /Lib
parent0ac59f93c0e3f91fd994d7245578cce65654fb22 (diff)
downloadcpython-9052f7a41b90f2d34011c8da68f9a4facebc8a97.zip
cpython-9052f7a41b90f2d34011c8da68f9a4facebc8a97.tar.gz
cpython-9052f7a41b90f2d34011c8da68f9a4facebc8a97.tar.bz2
bpo-39562: Allow executing asynchronous comprehensions in the asyncio REPL (GH-18968)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_builtin.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/Lib/test/test_builtin.py b/Lib/test/test_builtin.py
index d6b9ee1..1e9012e 100644
--- a/Lib/test/test_builtin.py
+++ b/Lib/test/test_builtin.py
@@ -390,7 +390,14 @@ class BuiltinTest(unittest.TestCase):
'''async for i in arange(1):
a = 1''',
'''async with asyncio.Lock() as l:
- a = 1'''
+ a = 1''',
+ '''a = [x async for x in arange(2)][1]''',
+ '''a = 1 in {x async for x in arange(2)}''',
+ '''a = {x:1 async for x in arange(1)}[0]''',
+ '''a = [x async for x in arange(2) async for x in arange(2)][1]''',
+ '''a = [x async for x in (x async for x in arange(5))][1]''',
+ '''a, = [1 for x in {x async for x in arange(1)}]''',
+ '''a = [await asyncio.sleep(0, x) async for x in arange(2)][1]'''
]
policy = maybe_get_event_loop_policy()
try: