From 07f46cf52527b54b3c45b5051513d3771aa97f7a Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Fri, 20 Oct 2023 12:39:19 +1300 Subject: [PATCH] Fix test on python 3.12 Builtin exception string format has changed --- tests/src/python/test_qgsexpression.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/src/python/test_qgsexpression.py b/tests/src/python/test_qgsexpression.py index 3a6c65cb49e2..6a3c30ebb478 100644 --- a/tests/src/python/test_qgsexpression.py +++ b/tests/src/python/test_qgsexpression.py @@ -333,8 +333,10 @@ def testExceptionDuringEvalReturnsTraceback(self): "name 'foo' is not defined:
Traceback \\(most recent call last\\):\n"
             "  File \".*qgsfunction.py\", line [0-9]+, in func\n"
             "    return self.function\\(\\*values, \\*\\*kwvalues\\)\n"
+            "(.*?\n)?"
             "  File \".*test_qgsexpression.py\", line [0-9]+, in raise_exception\n"
             "    foo  # noqa: F821\n"
+            "(.*?\n)?"
             "NameError: name \'foo\' is not defined"
             "\n
" )