Add test cases for RUF006 with lambdas (#13628)
As discussed in https://github.com/astral-sh/ruff/issues/13619
This commit is contained in:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user