Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2acfd4c

Browse files
committed
Python: Show we're able to handle example with __init__.py files
1 parent 85607fe commit 2acfd4c

7 files changed

Lines changed: 12 additions & 2 deletions

File tree

python/ql/test/experimental/library-tests/CallGraph-implicit-init/PointsTo.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ debug_missingAnnotationForCallable
22
debug_nonUniqueAnnotationForCallable
33
debug_missingAnnotationForCall
44
expectedCallEdgeNotFound
5-
| example.py:18:1:18:7 | afunc() | foo/bar/a.py:2:1:2:12 | Function afunc |
5+
| example.py:19:1:19:7 | afunc() | foo/bar/a.py:2:1:2:12 | Function afunc |
66
unexpectedCallEdgeFound

python/ql/test/experimental/library-tests/CallGraph-implicit-init/Relative.expected

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ debug_missingAnnotationForCallable
22
debug_nonUniqueAnnotationForCallable
33
debug_missingAnnotationForCall
44
pointsTo_found_typeTracker_notFound
5+
| example.py:22:1:22:16 | explicit_afunc() | foo_explicit/bar/a.py:2:1:2:21 | Function explicit_afunc |
56
pointsTo_notFound_typeTracker_found

python/ql/test/experimental/library-tests/CallGraph-implicit-init/TypeTracker.expected

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@ debug_missingAnnotationForCallable
22
debug_nonUniqueAnnotationForCallable
33
debug_missingAnnotationForCall
44
expectedCallEdgeNotFound
5-
| example.py:18:1:18:7 | afunc() | foo/bar/a.py:2:1:2:12 | Function afunc |
5+
| example.py:19:1:19:7 | afunc() | foo/bar/a.py:2:1:2:12 | Function afunc |
6+
| example.py:22:1:22:16 | explicit_afunc() | foo_explicit/bar/a.py:2:1:2:21 | Function explicit_afunc |
67
unexpectedCallEdgeFound

python/ql/test/experimental/library-tests/CallGraph-implicit-init/example.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
"""
1414

1515
from foo.bar.a import afunc
16+
from foo_explicit.bar.a import explicit_afunc
1617

1718
# calls:afunc
1819
afunc()
20+
21+
# calls:explicit_afunc
22+
explicit_afunc()

python/ql/test/experimental/library-tests/CallGraph-implicit-init/foo_explicit/__init__.py

Whitespace-only changes.

python/ql/test/experimental/library-tests/CallGraph-implicit-init/foo_explicit/bar/__init__.py

Whitespace-only changes.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# name:explicit_afunc
2+
def explicit_afunc():
3+
print("explicit_afunc called")
4+
return 1

0 commit comments

Comments
 (0)