summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2020-03-19 11:54:16 (GMT)
committerGitHub <noreply@github.com>2020-03-19 11:54:16 (GMT)
commitec8a973f7cf080d9c0679f058b2371f0b7c7862c (patch)
tree0aa575a974ae82609b4f9cae3702d20811c52114 /Lib/test
parentda1fe768e582387212201ab8737a1a5f26110664 (diff)
downloadcpython-ec8a973f7cf080d9c0679f058b2371f0b7c7862c.zip
cpython-ec8a973f7cf080d9c0679f058b2371f0b7c7862c.tar.gz
cpython-ec8a973f7cf080d9c0679f058b2371f0b7c7862c.tar.bz2
bpo-39562: Allow executing asynchronous comprehensions in the asyncio REPL (GH-18968)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com> (cherry picked from commit 9052f7a41b90f2d34011c8da68f9a4facebc8a97) Co-authored-by: Batuhan Taşkaya <47358913+isidentical@users.noreply.github.com>
Diffstat (limited to 'Lib/test')
-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 0d24158..f680e02 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: