diff options
author | Miro HronĨok <miro@hroncok.cz> | 2021-11-04 18:03:06 +0100 |
---|---|---|
committer | David Lord <davidism@gmail.com> | 2021-11-05 07:19:04 -0700 |
commit | 757756696ceebf9967ad8b8c6df60a2be7f23c51 (patch) | |
tree | 33acf3257b34c1cdd57f540899dad48a5386d69c /tests/test_debug.py | |
parent | acd4e343eeab6e22448f17efc2e8501607f00736 (diff) | |
download | jinja-757756696ceebf9967ad8b8c6df60a2be7f23c51.tar.gz |
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 <module>
{{ fail() }}
File ".../test_debug.py", line 32, in <lambda>
tmpl.render(fail=lambda: 1 / 0)
ZeroDivisionError: division by zero
After:
File ".../broken.html", line 2, in <module>
{{ fail() }}
^^^^^^^^^^^^
File ".../test_debug.py", line 32, in <lambda>
tmpl.render(fail=lambda: 1 / 0)
~~^~~
ZeroDivisionError: division by zero
Diffstat (limited to 'tests/test_debug.py')
-rw-r--r-- | tests/test_debug.py | 9 |
1 files changed, 6 insertions, 3 deletions
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|<module>) - \{\{ fail\(\) \}\} + \{\{ fail\(\) \}\}( + \^{12})? File ".*debug?.pyc?", line \d+, in <lambda> - 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""", ) |