Make test more idiomatic

This commit is contained in:
Diggory Blake 2017-03-23 17:51:45 +00:00 committed by Markus Unterwaditzer
parent 965d444e0f
commit 65cf64e019

View file

@ -800,11 +800,8 @@ def test_baseexception_error_handling():
raise KeyboardInterrupt()
with app.test_client() as c:
try:
with pytest.raises(KeyboardInterrupt):
c.get('/')
raise AssertionError("KeyboardInterrupt should have been raised")
except KeyboardInterrupt:
pass
ctx = flask._request_ctx_stack.top
assert ctx.preserved