Browse Source

failing test

pull/2362/head
David Lord 8 years ago
parent
commit
5c12acefbb
No known key found for this signature in database
GPG Key ID: 7A1C87E3F5BC42A8
  1. 33
      tests/test_basic.py

33
tests/test_basic.py

@ -980,6 +980,39 @@ def test_http_error_subclass_handling(app, client):
assert client.get('/3').data == b'apple'
def test_errorhandler_precedence(app, client):
class E1(Exception):
pass
class E2(Exception):
pass
class E3(E1, E2):
pass
@app.errorhandler(E2)
def handle_e2(e):
return 'E2'
@app.errorhandler(Exception)
def handle_exception(e):
return 'Exception'
@app.route('/E1')
def raise_e1():
raise E1
@app.route('/E3')
def raise_e3():
raise E3
rv = client.get('/E1')
assert rv.data == b'Exception'
rv = client.get('/E3')
assert rv.data == b'E2'
def test_trapping_of_bad_request_key_errors(app, client):
@app.route('/fail')
def fail():

Loading…
Cancel
Save