@@ -253,6 +253,39 @@ def foo(cls, bar):
253253 {},
254254 [(3 , 13 , "U100 Unused argument 'bar'" , "unused argument" )],
255255 ),
256+ (
257+ """
258+ def cool(a):
259+ def inner(b):
260+ pass
261+ async def async_inner(c):
262+ pass
263+ async def async_cool(d):
264+ def inner(e):
265+ pass
266+ async def async_inner(f):
267+ pass
268+ """ ,
269+ {},
270+ [
271+ (2 , 9 , "U100 Unused argument 'a'" , "unused argument" ),
272+ (3 , 14 , "U100 Unused argument 'b'" , "unused argument" ),
273+ (5 , 26 , "U100 Unused argument 'c'" , "unused argument" ),
274+ (7 , 21 , "U100 Unused argument 'd'" , "unused argument" ),
275+ (8 , 14 , "U100 Unused argument 'e'" , "unused argument" ),
276+ (10 , 26 , "U100 Unused argument 'f'" , "unused argument" ),
277+ ],
278+ ),
279+ (
280+ """
281+ # make sure we detect variables as used when they're referenced in an inner function
282+ def cool(a):
283+ def inner(c):
284+ a()
285+ """ ,
286+ {},
287+ [(4 , 14 , "U100 Unused argument 'c'" , "unused argument" )],
288+ ),
256289 ],
257290)
258291def test_integration (function , options , expected_warnings ):
0 commit comments