Skip to content
Myr

Tests: Adapt expected traceback regexes for Python 3.11.0a1

Before adoption: this commit came in with the history the project adopted, so no landing records it.

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

authored by Miro Hrončok · committed by David Lord · parent acd4e34 · Browse files · 1 file+6 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+6 added−3 removed

  • tests:+6 added−3 removed

1 file+6 added−3 removed

modified:tests/test_debug.py+6 added-3 removed
34 unmodified lines
35 self.assert_traceback_matches(36 test,37 r"""38 File ".*?broken.html", line 2, in (top-level template code|<module>)39 \{\{ fail\(\) \}\}39 \{\{ fail\(\) \}\}(40 \^{12})?41 File ".*debug?.pyc?", line \d+, in <lambda>41 tmpl\.render\(fail=lambda: 1 / 0\)42 tmpl\.render\(fail=lambda: 1 / 0\)(43 ~~\^~~)?44ZeroDivisionError: (int(eger)? )?division (or modulo )?by zero45""",46 )47
19 unmodified lines
67 self.assert_traceback_matches(68 test,69 r"""70 File ".*debug.pyc?", line \d+, in test69 raise TemplateSyntaxError\("wtf", 42\)71 raise TemplateSyntaxError\("wtf", 42\)(72 \^{36})?73(jinja2\.exceptions\.)?TemplateSyntaxError: wtf74 line 42""",75 )76
41 unmodified lines