From: Miro HronĨok Date: Thu, 4 Nov 2021 17:03:06 +0000 (+0100) Subject: Tests: Adapt expected traceback regexes for Python 3.11.0a1 X-Git-Tag: 3.0.3~11^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1527%2Fhead;p=thirdparty%2Fjinja.git Tests: Adapt expected traceback regexes for Python 3.11.0a1 Fixes https://github.com/pallets/jinja/issues/1526 Before: File ".../broken.html", line 2, in {{ fail() }} File ".../test_debug.py", line 32, in tmpl.render(fail=lambda: 1 / 0) ZeroDivisionError: division by zero After: File ".../broken.html", line 2, in {{ fail() }} ^^^^^^^^^^^^ File ".../test_debug.py", line 32, in tmpl.render(fail=lambda: 1 / 0) ~~^~~ ZeroDivisionError: division by zero --- diff --git a/tests/test_debug.py b/tests/test_debug.py index 0aec78ae..1cb931cf 100644 --- a/tests/test_debug.py +++ b/tests/test_debug.py @@ -36,9 +36,11 @@ class TestDebug: test, r""" File ".*?broken.html", line 2, in (top-level template code|) - \{\{ fail\(\) \}\} + \{\{ fail\(\) \}\}( + \^{12})? File ".*debug?.pyc?", line \d+, in - tmpl\.render\(fail=lambda: 1 / 0\) + tmpl\.render\(fail=lambda: 1 / 0\)( + ~~\^~~)? ZeroDivisionError: (int(eger)? )?division (or modulo )?by zero """, ) @@ -66,7 +68,8 @@ to be closed is 'for'. test, r""" File ".*debug.pyc?", line \d+, in test - raise TemplateSyntaxError\("wtf", 42\) + raise TemplateSyntaxError\("wtf", 42\)( + \^{36})? (jinja2\.exceptions\.)?TemplateSyntaxError: wtf line 42""", )