summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2020-09-05 15:37:04 (GMT)
committerGitHub <noreply@github.com>2020-09-05 15:37:04 (GMT)
commita708ae7470cf0abc58a62853c25d9bbc977f8cd1 (patch)
tree81fff06c447ad0b041576fc147bc7652c03bdee5
parent21100ab2798ec928c2e9fae89d7706be25fcf778 (diff)
downloadcpython-a708ae7470cf0abc58a62853c25d9bbc977f8cd1.zip
cpython-a708ae7470cf0abc58a62853c25d9bbc977f8cd1.tar.gz
cpython-a708ae7470cf0abc58a62853c25d9bbc977f8cd1.tar.bz2
bpo-41218: Improve the test cases for test_compile_top_level_await_no_coro (GH-21363) (GH-22109)
(cherry picked from commit c2c1f1f906cdeb40576880d4b6a4f8fcbc016eb8) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com> Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
-rw-r--r--Lib/test/test_builtin.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/Lib/test/test_builtin.py b/Lib/test/test_builtin.py
index 58c7305..4df1b95 100644
--- a/Lib/test/test_builtin.py
+++ b/Lib/test/test_builtin.py
@@ -372,12 +372,14 @@ class BuiltinTest(unittest.TestCase):
self.assertEqual(rv, tuple(expected))
def test_compile_top_level_await_no_coro(self):
- """Make sure top level non-await codes get the correct coroutine flags.
- """
+ """Make sure top level non-await codes get the correct coroutine flags"""
modes = ('single', 'exec')
code_samples = [
'''def f():pass\n''',
- '''[x for x in l]'''
+ '''[x for x in l]''',
+ '''{x for x in l}''',
+ '''(x for x in l)''',
+ '''{x:x for x in l}''',
]
for mode, code_sample in product(modes, code_samples):
source = dedent(code_sample)