Home / Function/ test_blueprint_specific_error_handling() — flask Function Reference

test_blueprint_specific_error_handling() — flask Function Reference

Architecture documentation for the test_blueprint_specific_error_handling() function in test_blueprints.py from the flask codebase.

Entity Profile

Dependency Diagram

graph TD
  cd6377e7_51f7_e7ac_f777_b2f1a737e580["test_blueprint_specific_error_handling()"]
  4366a441_d387_52f9_ec8d_1c41c71c00a8["test_blueprints.py"]
  cd6377e7_51f7_e7ac_f777_b2f1a737e580 -->|defined in| 4366a441_d387_52f9_ec8d_1c41c71c00a8
  style cd6377e7_51f7_e7ac_f777_b2f1a737e580 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_blueprints.py lines 8–43

def test_blueprint_specific_error_handling(app, client):
    frontend = flask.Blueprint("frontend", __name__)
    backend = flask.Blueprint("backend", __name__)
    sideend = flask.Blueprint("sideend", __name__)

    @frontend.errorhandler(403)
    def frontend_forbidden(e):
        return "frontend says no", 403

    @frontend.route("/frontend-no")
    def frontend_no():
        flask.abort(403)

    @backend.errorhandler(403)
    def backend_forbidden(e):
        return "backend says no", 403

    @backend.route("/backend-no")
    def backend_no():
        flask.abort(403)

    @sideend.route("/what-is-a-sideend")
    def sideend_no():
        flask.abort(403)

    app.register_blueprint(frontend)
    app.register_blueprint(backend)
    app.register_blueprint(sideend)

    @app.errorhandler(403)
    def app_forbidden(e):
        return "application itself says no", 403

    assert client.get("/frontend-no").data == b"frontend says no"
    assert client.get("/backend-no").data == b"backend says no"
    assert client.get("/what-is-a-sideend").data == b"application itself says no"

Subdomains

Frequently Asked Questions

What does test_blueprint_specific_error_handling() do?
test_blueprint_specific_error_handling() is a function in the flask codebase, defined in tests/test_blueprints.py.
Where is test_blueprint_specific_error_handling() defined?
test_blueprint_specific_error_handling() is defined in tests/test_blueprints.py at line 8.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free