mirror of
https://github.com/github/codeql.git
synced 2026-04-29 10:45:15 +02:00
Python: Fix tests
With `ModuleVariableNode`s now appearing for _all_ global variables (not just the ones that actually seem to be used), some of the tests changed a bit. Mostly this was in the form of new flow (because of new nodes that popped into existence). For some inline expectation tests, I opted to instead exclude these results, as there was no suitable location to annotate. For the normal tests, I just accepted the output (after having vetted it carefully, of course).
This commit is contained in:
@@ -17,7 +17,9 @@ module InlinePoorMansFunctionResolutionTest implements TestSig {
|
||||
) and
|
||||
// exclude decorator calls (which with our extractor rewrites does reference the
|
||||
// function)
|
||||
not ref.asExpr() = func.getDefinition().(FunctionExpr).getADecoratorCall()
|
||||
not ref.asExpr() = func.getDefinition().(FunctionExpr).getADecoratorCall() and
|
||||
// exclude ModuleVariableNodes (which have location 0:0:0:0)
|
||||
not ref instanceof DataFlow::ModuleVariableNode
|
||||
|
|
||||
value = func.getName() and
|
||||
tag = "resolved" and
|
||||
|
||||
Reference in New Issue
Block a user