Add test cases for RUF006 with lambdas (#13628)

As discussed in https://github.com/astral-sh/ruff/issues/13619
This commit is contained in:
Zanie Blue
2024-10-04 14:09:43 -05:00
committed by GitHub
parent 888930b7d3
commit 020f4d4a54

View File

@@ -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]