Python: tests with false positives around match

This commit is contained in:
Paolo Tranquilli
2024-06-14 17:23:23 +02:00
parent 3d037e73f0
commit daea773fce
4 changed files with 21 additions and 1 deletions

View File

@@ -1,2 +1,3 @@
| functions_test.py:18:1:18:11 | Function cr1 | Mixing implicit and explicit returns may indicate an error as implicit returns always return None. |
| functions_test.py:22:1:22:11 | Function cr2 | Mixing implicit and explicit returns may indicate an error as implicit returns always return None. |
| functions_test.py:336:1:336:16 | Function ok_match | Mixing implicit and explicit returns may indicate an error as implicit returns always return None. |

View File

@@ -330,4 +330,12 @@ def indirectly_returning_different_tuple_sizes(x):
def mismatched_multi_assign(x):
a,b = returning_different_tuple_sizes(x)
return a,b
return a,b
def ok_match(x): # FP
match x:
case True | 'true':
return 0
case _:
raise ValueError(x)