Make test more idiomatic

This commit is contained in:
Diggory Blake 2017-03-23 17:51:45 +00:00 committed by Markus Unterwaditzer
parent d0e2e7b66c
commit 6f7847e3c4

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