]> 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)
authorPablo Galindo <Pablogsal@gmail.com>
Mon, 6 Jul 2020 22:30:14 +0000 (23:30 +0100)
committerGitHub <noreply@github.com>
Mon, 6 Jul 2020 22:30:14 +0000 (23:30 +0100)
Lib/test/test_builtin.py

index 3dcdf8d903059b691fd47ea8405bef896211a682..3bc1a3e246fdf84c5301aa37e662ee4329f8e0d3 100644 (file)
@@ -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)