mirror of
https://github.com/github/codeql.git
synced 2026-06-19 03:41:07 +02:00
Convert Python qlref tests to inline expectations
This commit is contained in:
@@ -1 +1,2 @@
|
||||
Exceptions/CatchingBaseException.ql
|
||||
query: Exceptions/CatchingBaseException.ql
|
||||
postprocess: utils/test/InlineExpectationsTestQuery.ql
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
Exceptions/EmptyExcept.ql
|
||||
query: Exceptions/EmptyExcept.ql
|
||||
postprocess: utils/test/InlineExpectationsTestQuery.ql
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
Exceptions/IllegalExceptionHandlerType.ql
|
||||
query: Exceptions/IllegalExceptionHandlerType.ql
|
||||
postprocess: utils/test/InlineExpectationsTestQuery.ql
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
Exceptions/IllegalRaise.ql
|
||||
query: Exceptions/IllegalRaise.ql
|
||||
postprocess: utils/test/InlineExpectationsTestQuery.ql
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
Exceptions/IncorrectExceptOrder.ql
|
||||
query: Exceptions/IncorrectExceptOrder.ql
|
||||
postprocess: utils/test/InlineExpectationsTestQuery.ql
|
||||
|
||||
@@ -14,4 +14,4 @@ def raise_tuple(cond):
|
||||
raise (Exception, "bananas", 17)
|
||||
else:
|
||||
#This is an error
|
||||
raise (17, "bananas", Exception)
|
||||
raise (17, "bananas", Exception) # $ Alert[py/illegal-raise]
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
Exceptions/UnguardedNextInGenerator.ql
|
||||
query: Exceptions/UnguardedNextInGenerator.ql
|
||||
postprocess: utils/test/InlineExpectationsTestQuery.ql
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
|
||||
def bad1(it):
|
||||
while True:
|
||||
yield next(it)
|
||||
yield next(it) # $ Alert
|
||||
|
||||
def bad2(seq):
|
||||
it = iter(seq)
|
||||
#Not OK as seq may be empty
|
||||
raise KeyError(next(it))
|
||||
raise KeyError(next(it)) # $ Alert
|
||||
yield 0
|
||||
|
||||
def ok1(seq):
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
Exceptions/RaisingTuple.ql
|
||||
query: Exceptions/RaisingTuple.ql
|
||||
postprocess: utils/test/InlineExpectationsTestQuery.ql
|
||||
|
||||
@@ -5,11 +5,11 @@ def ok():
|
||||
|
||||
def bad1():
|
||||
ex = Exception, "message"
|
||||
raise ex
|
||||
raise ex # $ Alert
|
||||
|
||||
def bad2():
|
||||
raise (Exception, "message")
|
||||
raise (Exception, "message") # $ Alert
|
||||
|
||||
def bad3():
|
||||
ex = Exception,
|
||||
raise ex, "message"
|
||||
raise ex, "message" # $ Alert
|
||||
|
||||
Reference in New Issue
Block a user