Python: Add test-case with swapped decorator order

This commit is contained in:
Rasmus Wriedt Larsen
2020-03-24 14:18:46 +01:00
parent 3ed48aae4c
commit 05ecfc83f7
2 changed files with 8 additions and 0 deletions

View File

@@ -3,3 +3,5 @@
| test.py:17:15:17:17 | ControlFlowNode for cls | self instance of Foo |
| test.py:22:15:22:17 | ControlFlowNode for cls | class Foo |
| test.py:22:15:22:17 | ControlFlowNode for cls | self instance of Foo |
| test.py:27:15:27:17 | ControlFlowNode for cls | class Foo |
| test.py:27:15:27:17 | ControlFlowNode for cls | self instance of Foo |

View File

@@ -21,9 +21,15 @@ class Foo(object):
def problem_through_class(cls):
check(cls) # same as above
@classmethod
@some_decorator
def also_problem(cls):
check(cls) # same as above
# We need to call the methods before our analysis works
f1 = Foo()
f1.no_problem()
f1.problem_through_instance()
f1.also_problem()
Foo.problem_through_class()