test_error_handling() — flask Function Reference
Architecture documentation for the test_error_handling() function in test_basic.py from the flask codebase.
Entity Profile
Dependency Diagram
graph TD 32629bcf_076d_9fc8_fb8f_99328867252e["test_error_handling()"] 85bc4fb5_d1d7_a135_020d_69e052c12c0f["test_basic.py"] 32629bcf_076d_9fc8_fb8f_99328867252e -->|defined in| 85bc4fb5_d1d7_a135_020d_69e052c12c0f 6ea1611d_2801_3cb5_a5b9_5b6403cc0537["index()"] 32629bcf_076d_9fc8_fb8f_99328867252e -->|calls| 6ea1611d_2801_3cb5_a5b9_5b6403cc0537 style 32629bcf_076d_9fc8_fb8f_99328867252e fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
tests/test_basic.py lines 867–902
def test_error_handling(app, client):
app.testing = False
@app.errorhandler(404)
def not_found(e):
return "not found", 404
@app.errorhandler(500)
def internal_server_error(e):
return "internal server error", 500
@app.errorhandler(Forbidden)
def forbidden(e):
return "forbidden", 403
@app.route("/")
def index():
flask.abort(404)
@app.route("/error")
def error():
raise ZeroDivisionError
@app.route("/forbidden")
def error2():
flask.abort(403)
rv = client.get("/")
assert rv.status_code == 404
assert rv.data == b"not found"
rv = client.get("/error")
assert rv.status_code == 500
assert b"internal server error" == rv.data
rv = client.get("/forbidden")
assert rv.status_code == 403
assert b"forbidden" == rv.data
Domain
Subdomains
Defined In
Calls
Source
Frequently Asked Questions
What does test_error_handling() do?
test_error_handling() is a function in the flask codebase, defined in tests/test_basic.py.
Where is test_error_handling() defined?
test_error_handling() is defined in tests/test_basic.py at line 867.
What does test_error_handling() call?
test_error_handling() calls 1 function(s): index.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free