Python: Show we're able to handle example with __init__.py files

This commit is contained in:
Rasmus Wriedt Larsen
2020-09-25 18:28:31 +02:00
parent 85607fe2d5
commit 2acfd4cdb1
7 changed files with 12 additions and 2 deletions

View File

@@ -2,5 +2,5 @@ debug_missingAnnotationForCallable
debug_nonUniqueAnnotationForCallable
debug_missingAnnotationForCall
expectedCallEdgeNotFound
| example.py:18:1:18:7 | afunc() | foo/bar/a.py:2:1:2:12 | Function afunc |
| example.py:19:1:19:7 | afunc() | foo/bar/a.py:2:1:2:12 | Function afunc |
unexpectedCallEdgeFound

View File

@@ -2,4 +2,5 @@ debug_missingAnnotationForCallable
debug_nonUniqueAnnotationForCallable
debug_missingAnnotationForCall
pointsTo_found_typeTracker_notFound
| example.py:22:1:22:16 | explicit_afunc() | foo_explicit/bar/a.py:2:1:2:21 | Function explicit_afunc |
pointsTo_notFound_typeTracker_found

View File

@@ -2,5 +2,6 @@ debug_missingAnnotationForCallable
debug_nonUniqueAnnotationForCallable
debug_missingAnnotationForCall
expectedCallEdgeNotFound
| example.py:18:1:18:7 | afunc() | foo/bar/a.py:2:1:2:12 | Function afunc |
| example.py:19:1:19:7 | afunc() | foo/bar/a.py:2:1:2:12 | Function afunc |
| example.py:22:1:22:16 | explicit_afunc() | foo_explicit/bar/a.py:2:1:2:21 | Function explicit_afunc |
unexpectedCallEdgeFound

View File

@@ -13,6 +13,10 @@ Since PEP 420 was accepted in Python 3, this test is Python 3 only.
"""
from foo.bar.a import afunc
from foo_explicit.bar.a import explicit_afunc
# calls:afunc
afunc()
# calls:explicit_afunc
explicit_afunc()

View File

@@ -0,0 +1,4 @@
# name:explicit_afunc
def explicit_afunc():
print("explicit_afunc called")
return 1