]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-41218: Improve the test cases for test_compile_top_level_await_no_coro (GH-21363)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 6 Jul 2020 23:30:46 +0000 (16:30 -0700)
committerGitHub <noreply@github.com>
Mon, 6 Jul 2020 23:30:46 +0000 (16:30 -0700)
(cherry picked from commit c2c1f1f906cdeb40576880d4b6a4f8fcbc016eb8)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
Lib/test/test_builtin.py

index f47689dfdea4195d9393d696c5dc5b92729f713e..4a498262ba637952bcd549454613ccafdeef0406 100644 (file)
@@ -371,12 +371,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)