mirror of
https://github.com/github/codeql.git
synced 2026-04-28 02:05:14 +02:00
Python: Update test cases
Adds a comment explaining why we no longer flag the indirect tuple example. Also adds a test case which _would_ be flagged if not for the type annotation.
This commit is contained in:
@@ -321,7 +321,7 @@ def function_returning_2_tuple():
|
||||
def function_returning_3_tuple():
|
||||
return 1,2,3
|
||||
|
||||
def indirectly_returning_different_tuple_sizes(x):
|
||||
def indirectly_returning_different_tuple_sizes(x): # OK, since we only look at local tuple returns
|
||||
if x:
|
||||
return function_returning_2_tuple()
|
||||
else:
|
||||
@@ -347,3 +347,9 @@ def ok_match2(x): # FP
|
||||
return 0
|
||||
case _:
|
||||
return 1
|
||||
|
||||
def ok_tuple_returns_captured_in_type(x: bool) -> tuple[int, ...]: # OK because there is a type annotation present
|
||||
if x:
|
||||
return 1, 2
|
||||
else:
|
||||
return 1, 2, 3
|
||||
|
||||
Reference in New Issue
Block a user