Skip to content

Commit

Permalink
SONARPY-2385 Add test for S5756 about uncallable lambda (#2215)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-serre-sonarsource authored Dec 6, 2024
1 parent 49a184c commit 4d80324
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions python-checks/src/test/resources/checks/nonCallableCalled.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,3 +407,7 @@ def function_type_is_callable():
def object_typevar():
scheduled = []
scheduled.pop()() # OK

def uncallable_inside_lambda_are_non_compliant():
lambda_call = (lambda : print("something"))() # OK
uncallable_inside_lambda = lambda:(print("something"))() # Noncompliant

0 comments on commit 4d80324

Please sign in to comment.