diff options
Diffstat (limited to 'tests/test_lexnparse.py')
-rw-r--r-- | tests/test_lexnparse.py | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/tests/test_lexnparse.py b/tests/test_lexnparse.py index f6a3129..cc941eb 100644 --- a/tests/test_lexnparse.py +++ b/tests/test_lexnparse.py @@ -251,12 +251,8 @@ and bar comment #} def test_error_messages(self, env): def assert_error(code, expected): - try: + with pytest.raises(TemplateSyntaxError, match=expected): Template(code) - except TemplateSyntaxError as e: - assert str(e) == expected, 'unexpected error message' - else: - assert False, 'that was supposed to be an error' assert_error('{% for item in seq %}...{% endif %}', "Encountered unknown tag 'endif'. Jinja was looking " |