Skip to content

Commit

Permalink
SONARPY-2255 add tests for S5756 on aliased classes (#2129)
Browse files Browse the repository at this point in the history
Co-authored-by: Guillaume Dequenne <[email protected]>
  • Loading branch information
1 parent c48a2ff commit db907a1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
class MyNonCallableClass:
...

MyNonCallableClassAlias = MyNonCallableClass

class MyCallableClass:
def __call__(self):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
from nonCallableCalledImported import MyNonCallableClass, MyCallableClass

import nonCallableCalledImported

imported_non_callable = MyNonCallableClass()
imported_non_callable_alias = nonCallableCalledImported.MyNonCallableClassAlias()
imported_callable = MyCallableClass()

imported_non_callable() # Noncompliant
imported_non_callable_alias() # FN : this is non callable
imported_callable()


Expand Down

0 comments on commit db907a1

Please sign in to comment.