MCPcopy Create free account
hub / github.com/pallets/flask / test_error_handling_processing

Function test_error_handling_processing

tests/test_basic.py:898–916  ·  view source on GitHub ↗
(app, client)

Source from the content-addressed store, hash-verified

896
897
898def test_error_handling_processing(app, client):
899 app.testing = False
900
901 @app.errorhandler(500)
902 def internal_server_error(e):
903 return "internal server error", 500
904
905 @app.route("/")
906 def broken_func():
907 raise ZeroDivisionError
908
909 @app.after_request
910 def after_request(resp):
911 resp.mimetype = "text/x-special"
912 return resp
913
914 resp = client.get("/")
915 assert resp.mimetype == "text/x-special"
916 assert resp.data == b"internal server error"
917
918
919def test_baseexception_error_handling(app, client):

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected