Skip to content

Commit 05ecfc8

Browse files
committed
Python: Add test-case with swapped decorator order
1 parent 3ed48aa commit 05ecfc8

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

python/ql/test/library-tests/PointsTo/regressions/wrong/classmethod/Test.expected

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@
33
| test.py:17:15:17:17 | ControlFlowNode for cls | self instance of Foo |
44
| test.py:22:15:22:17 | ControlFlowNode for cls | class Foo |
55
| test.py:22:15:22:17 | ControlFlowNode for cls | self instance of Foo |
6+
| test.py:27:15:27:17 | ControlFlowNode for cls | class Foo |
7+
| test.py:27:15:27:17 | ControlFlowNode for cls | self instance of Foo |

python/ql/test/library-tests/PointsTo/regressions/wrong/classmethod/test.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,15 @@ def problem_through_instance(cls):
2121
def problem_through_class(cls):
2222
check(cls) # same as above
2323

24+
@classmethod
25+
@some_decorator
26+
def also_problem(cls):
27+
check(cls) # same as above
28+
2429
# We need to call the methods before our analysis works
2530
f1 = Foo()
2631
f1.no_problem()
2732
f1.problem_through_instance()
33+
f1.also_problem()
2834

2935
Foo.problem_through_class()

0 commit comments

Comments
 (0)