From ff4c11f503755f0cbaddedd13df875eb5596ee7a Mon Sep 17 00:00:00 2001 From: Joe Farebrother Date: Sat, 6 Sep 2025 00:45:15 +0100 Subject: [PATCH] Update test output. Accepting some FNs due to dataflow issue. --- .../Exceptions/general/CatchingBaseException.expected | 2 +- .../test/query-tests/Exceptions/general/EmptyExcept.expected | 3 +++ .../Exceptions/general/IllegalExceptionHandlerType.expected | 2 +- .../Exceptions/general/IncorrectExceptOrder.expected | 2 +- .../general/NotImplementedIsNotAnException.expected | 4 ++-- .../ql/test/query-tests/Exceptions/general/exceptions_test.py | 4 ++-- 6 files changed, 10 insertions(+), 7 deletions(-) diff --git a/python/ql/test/query-tests/Exceptions/general/CatchingBaseException.expected b/python/ql/test/query-tests/Exceptions/general/CatchingBaseException.expected index 8cbb6d9c961..dbc838a90be 100644 --- a/python/ql/test/query-tests/Exceptions/general/CatchingBaseException.expected +++ b/python/ql/test/query-tests/Exceptions/general/CatchingBaseException.expected @@ -1,2 +1,2 @@ | exceptions_test.py:7:5:7:11 | ExceptStmt | Except block directly handles BaseException. | -| exceptions_test.py:71:5:71:25 | ExceptStmt | Except block directly handles BaseException. | +| exceptions_test.py:97:5:97:25 | ExceptStmt | Except block directly handles BaseException. | diff --git a/python/ql/test/query-tests/Exceptions/general/EmptyExcept.expected b/python/ql/test/query-tests/Exceptions/general/EmptyExcept.expected index 57c50449af8..f9d9c69dd87 100644 --- a/python/ql/test/query-tests/Exceptions/general/EmptyExcept.expected +++ b/python/ql/test/query-tests/Exceptions/general/EmptyExcept.expected @@ -1,2 +1,5 @@ | exceptions_test.py:7:5:7:11 | ExceptStmt | 'except' clause does nothing but pass and there is no explanatory comment. | | exceptions_test.py:13:5:13:21 | ExceptStmt | 'except' clause does nothing but pass and there is no explanatory comment. | +| exceptions_test.py:72:1:72:18 | ExceptStmt | 'except' clause does nothing but pass and there is no explanatory comment. | +| exceptions_test.py:85:1:85:17 | ExceptStmt | 'except' clause does nothing but pass and there is no explanatory comment. | +| exceptions_test.py:89:1:89:17 | ExceptStmt | 'except' clause does nothing but pass and there is no explanatory comment. | diff --git a/python/ql/test/query-tests/Exceptions/general/IllegalExceptionHandlerType.expected b/python/ql/test/query-tests/Exceptions/general/IllegalExceptionHandlerType.expected index 0864dd0fe30..5ba0c716371 100644 --- a/python/ql/test/query-tests/Exceptions/general/IllegalExceptionHandlerType.expected +++ b/python/ql/test/query-tests/Exceptions/general/IllegalExceptionHandlerType.expected @@ -1,4 +1,4 @@ | exceptions_test.py:51:5:51:25 | ExceptStmt | Non-exception $@ in exception handler which will never match raised exception. | exceptions_test.py:33:1:33:28 | ControlFlowNode for ClassExpr | class 'NotException1' | | exceptions_test.py:54:5:54:25 | ExceptStmt | Non-exception $@ in exception handler which will never match raised exception. | exceptions_test.py:36:1:36:28 | ControlFlowNode for ClassExpr | class 'NotException2' | -| exceptions_test.py:112:5:112:22 | ExceptStmt | Non-exception $@ in exception handler which will never match raised exception. | exceptions_test.py:107:12:107:14 | ControlFlowNode for FloatLiteral | instance of 'float' | +| exceptions_test.py:138:5:138:22 | ExceptStmt | Non-exception $@ in exception handler which will never match raised exception. | exceptions_test.py:133:12:133:14 | ControlFlowNode for FloatLiteral | instance of 'float' | | pypy_test.py:14:5:14:14 | ExceptStmt | Non-exception $@ in exception handler which will never match raised exception. | pypy_test.py:14:12:14:13 | ControlFlowNode for IntegerLiteral | instance of 'int' | diff --git a/python/ql/test/query-tests/Exceptions/general/IncorrectExceptOrder.expected b/python/ql/test/query-tests/Exceptions/general/IncorrectExceptOrder.expected index 160d5176724..3fab57be376 100644 --- a/python/ql/test/query-tests/Exceptions/general/IncorrectExceptOrder.expected +++ b/python/ql/test/query-tests/Exceptions/general/IncorrectExceptOrder.expected @@ -1 +1 @@ -| exceptions_test.py:64:1:64:22 | ExceptStmt | Except block for $@ is unreachable; the more general $@ for $@ will always be executed in preference. | file://:0:0:0:0 | builtin-class AttributeError | AttributeError | exceptions_test.py:62:1:62:17 | ExceptStmt | except block | file://:0:0:0:0 | builtin-class Exception | Exception | +| exceptions_test.py:64:1:64:22 | ExceptStmt | This except block handling $@ is unreachable; as $@ for the more general $@ always subsumes it. | file://:0:0:0:0 | AttributeError | AttributeError | exceptions_test.py:62:1:62:17 | ExceptStmt | this except block | file://:0:0:0:0 | Exception | Exception | diff --git a/python/ql/test/query-tests/Exceptions/general/NotImplementedIsNotAnException.expected b/python/ql/test/query-tests/Exceptions/general/NotImplementedIsNotAnException.expected index 7c5ee490b4e..0bb863ccfed 100644 --- a/python/ql/test/query-tests/Exceptions/general/NotImplementedIsNotAnException.expected +++ b/python/ql/test/query-tests/Exceptions/general/NotImplementedIsNotAnException.expected @@ -1,2 +1,2 @@ -| exceptions_test.py:170:11:170:24 | NotImplemented | NotImplemented is not an Exception. Did you mean NotImplementedError? | -| exceptions_test.py:173:11:173:26 | NotImplemented() | NotImplemented is not an Exception. Did you mean NotImplementedError? | +| exceptions_test.py:196:11:196:24 | NotImplemented | NotImplemented is not an Exception. Did you mean NotImplementedError? | +| exceptions_test.py:199:11:199:26 | NotImplemented() | NotImplemented is not an Exception. Did you mean NotImplementedError? | diff --git a/python/ql/test/query-tests/Exceptions/general/exceptions_test.py b/python/ql/test/query-tests/Exceptions/general/exceptions_test.py index 291b3cb30e0..cf197683f15 100644 --- a/python/ql/test/query-tests/Exceptions/general/exceptions_test.py +++ b/python/ql/test/query-tests/Exceptions/general/exceptions_test.py @@ -71,7 +71,7 @@ try: pass except ValueError: pass -except MyExc: # $Alert[py/unreachable-except] +except MyExc: # $MISSING:Alert[py/unreachable-except] # Missing due to dataflow limitiation preventing MyExc from being tracked here. pass class MyBaseExc(Exception): @@ -84,7 +84,7 @@ try: pass except MyBaseExc: pass -except MySubExc: # $Alert[py/unreachable-except] +except MySubExc: # $MISSING:Alert[py/unreachable-except] # Missing due to dataflow limitation preventing MyExc from being tracked here. pass except Exception: pass