Python: Add tests · Pistchofe/ms-codeql@c6c6a85 · GitHub
Skip to content

Commit c6c6a85

Browse files
committed
Python: Add tests
Also fixes an issue with the return type annotations that caused these to not work properly. Currently, annotated assignments don't work properly, due to the fact that our flow relation doesn't consider flow going to the "type" part of an annotated assignment. This means that in `x : Foo`, we do correctly note that `x` is annotated with `Foo`, but we have no idea what `Foo` is, since it has no incoming flow. To fix this we should probably just extend the flow relation, but this may need to be done with some care, so I have left it as future work.
1 parent 2c45550 commit c6c6a85

4 files changed

Lines changed: 42 additions & 2 deletions

File tree

‎python/ql/lib/semmle/python/Exprs.qll‎

Lines changed: 2 additions & 2 deletions
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
testFailures
2+
debug_callableNotUnique
3+
pointsTo_found_typeTracker_notFound
4+
typeTracker_found_pointsTo_notFound
5+
| type_annotations.py:6:5:6:14 | ControlFlowNode for Attribute() | Foo.method |
6+
| type_annotations.py:16:5:16:14 | ControlFlowNode for Attribute() | Foo.method |
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../CallGraph/InlineCallGraphTest.ql
Lines changed: 33 additions & 0 deletions

0 commit comments

Comments
 (0)