bpo-41218: Improve the test cases for test_compile_top_level_await_no_coro (GH-21363) (GH-22109)

(cherry picked from commit c2c1f1f906)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
This commit is contained in:
Miss Islington (bot) 2020-09-05 08:37:04 -07:00 committed by GitHub
parent 21100ab279
commit a708ae7470
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 3 deletions

View 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)