Python: Add 2/3 specific query tests.

This commit is contained in:
Mark Shannon
2019-02-08 15:04:44 +00:00
parent 0558b58193
commit 52ddd79cab
152 changed files with 919 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
| UndefinedExport.py:3:18:3:20 | Str | The name 'y' is exported by __all__ but is not defined. |
| UndefinedExport.py:3:23:3:25 | Str | The name 'z' is exported by __all__ but is not defined. |
| UndefinedExport.py:3:28:3:35 | Str | The name 'module' is exported by __all__ but is not defined. |
| package/__init__.py:1:23:1:34 | Str | The name 'not_exists' is exported by __all__ but is not defined. |

View File

@@ -0,0 +1,15 @@
__all__ = [ "x", "y", "z", "module", "w" ]
x = 1
if 0:
y = 2
import package.module
def init():
global w
w = 1
init()

View File

@@ -0,0 +1 @@
Variables/UndefinedExport.ql

View File

@@ -0,0 +1,3 @@
def kwonly(p0, *, kw=None):
return kw

View File

@@ -0,0 +1 @@
Variables/UninitializedLocal.ql

View File

@@ -0,0 +1,8 @@
from enum import IntEnum
IntEnum._convert(
'Maybe',
__name__,
lambda C: C.isupper() and C.startswith('AF_'))
__all__ = [ "Maybe", "Maybe_not" ]

View File

@@ -0,0 +1,6 @@
__all__ = [ "a", "b" ]
from cant_resolve import *

View File

@@ -0,0 +1,5 @@
__all__ = [ "a", "b" ]
globals().update({'a':1, 'b':2})

View File

@@ -0,0 +1 @@
semmle-extractor-options: --max-import-depth=2

View File

@@ -0,0 +1 @@
__all__ = [ "module", "not_exists" ]