(app, client)
| 942 | |
| 943 | |
| 944 | def test_user_error_handling(app, client): |
| 945 | class MyException(Exception): |
| 946 | pass |
| 947 | |
| 948 | @app.errorhandler(MyException) |
| 949 | def handle_my_exception(e): |
| 950 | assert isinstance(e, MyException) |
| 951 | return "42" |
| 952 | |
| 953 | @app.route("/") |
| 954 | def index(): |
| 955 | raise MyException() |
| 956 | |
| 957 | assert client.get("/").data == b"42" |
| 958 | |
| 959 | |
| 960 | def test_http_error_subclass_handling(app, client): |