diff options
Diffstat (limited to 'tests/test_async.py')
-rw-r--r-- | tests/test_async.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/tests/test_async.py b/tests/test_async.py index 2f17747..92ac2a3 100644 --- a/tests/test_async.py +++ b/tests/test_async.py @@ -191,13 +191,11 @@ class TestAsyncIncludes(object): t = test_env_async.from_string('{% include ["missing", "missing2"] %}') pytest.raises(TemplateNotFound, t.render) - try: + with pytest.raises(TemplatesNotFound) as e: t.render() - except TemplatesNotFound as e: - assert e.templates == ['missing', 'missing2'] - assert e.name == 'missing2' - else: - assert False, 'thou shalt raise' + + assert e.value.templates == ['missing', 'missing2'] + assert e.value.name == 'missing2' def test_includes(t, **ctx): ctx['foo'] = 42 |