From ca72c5f301d1aa2ce0e75b440dc6364b4a69bbeb Mon Sep 17 00:00:00 2001 From: Kevin Brown Date: Thu, 10 Oct 2019 02:15:15 -0400 Subject: Replaced try...catch within tests with pytest.raises This still leaves one in test_debug which relies on reading out the traceback and cannot easily be replaced by pytest.raises like the others. --- tests/test_inheritance.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'tests/test_inheritance.py') diff --git a/tests/test_inheritance.py b/tests/test_inheritance.py index 7746c2d..e753506 100644 --- a/tests/test_inheritance.py +++ b/tests/test_inheritance.py @@ -242,7 +242,5 @@ class TestBugFix(object): """Ensures that a template with more than 1 {% extends ... %} usage raises a ``TemplateError``. """ - try: + with pytest.raises(TemplateError): tmpl = env.get_template('doublee') - except Exception as e: - assert isinstance(e, TemplateError) -- cgit v1.2.1