mirror of
https://github.com/github/codeql.git
synced 2026-05-05 13:45:19 +02:00
Python: Add test cases
I debated whether to add a
`MISSING: use=moduleImport("builtins").getMember("print").getReturn()`
annotation to the last line.
Ultimately, I decided to add it, as we likely _do_ want this information
to propagate into inner functions (even if the value of `var2` may
change before `func4` is called).
This commit is contained in:
@@ -23,3 +23,13 @@ def foo():
|
||||
def quux():
|
||||
global non_module_member
|
||||
non_module_member = 5
|
||||
|
||||
def func1():
|
||||
var() #$ use=moduleImport("unknown").getMember("var").getReturn()
|
||||
def func2():
|
||||
var = "FOO"
|
||||
|
||||
def func3():
|
||||
var2 = print #$ use=moduleImport("builtins").getMember("print")
|
||||
def func4():
|
||||
var2() #$ MISSING: use=moduleImport("builtins").getMember("print").getReturn()
|
||||
|
||||
Reference in New Issue
Block a user