blob: 9f293b47d323f037b04ac0e1001add83a2d54466 [file] [log] [blame]
"""Test that `yield` or `yield from` can't be used inside an async function."""
# pylint: disable=missing-docstring, unused-variable
async def good():
def _inner():
yield 42
yield from [1, 2, 3]
async def good_two():
# Starting from python 3.6 it's possible to yield inside async
# https://www.python.org/dev/peps/pep-0525/
yield 42
async def bad():
yield from [1, 2, 3] # [yield-inside-async-function]