diff --git a/crates/ruff_linter/resources/test/fixtures/ruff/RUF006.py b/crates/ruff_linter/resources/test/fixtures/ruff/RUF006.py index 2db2e711d54a3..1944d7429de03 100644 --- a/crates/ruff_linter/resources/test/fixtures/ruff/RUF006.py +++ b/crates/ruff_linter/resources/test/fixtures/ruff/RUF006.py @@ -185,3 +185,9 @@ def f(): global task loop = asyncio.get_event_loop() task = loop.create_task(main()) # Error + +# OK +# The task is returned by the lambda +f = lambda *args: asyncio.create_task(foo()) +f = lambda *args: lambda *args: asyncio.create_task(foo()) +f = lambda *args: [asyncio.create_task(foo()) for x in args]