Home / Function/ test_error_handler_blueprint() — flask Function Reference

test_error_handler_blueprint() — flask Function Reference

Architecture documentation for the test_error_handler_blueprint() function in test_user_error_handler.py from the flask codebase.

Entity Profile

Dependency Diagram

graph TD
  4c8700a5_542e_e25d_21e1_5d5d25309bb3["test_error_handler_blueprint()"]
  f3be1606_1a20_1a1b_2703_48b5b295bc8d["test_user_error_handler.py"]
  4c8700a5_542e_e25d_21e1_5d5d25309bb3 -->|defined in| f3be1606_1a20_1a1b_2703_48b5b295bc8d
  style 4c8700a5_542e_e25d_21e1_5d5d25309bb3 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_user_error_handler.py lines 136–160

def test_error_handler_blueprint(app):
    bp = flask.Blueprint("bp", __name__)

    @bp.errorhandler(500)
    def bp_exception_handler(e):
        return "bp-error"

    @bp.route("/error")
    def bp_test():
        raise InternalServerError()

    @app.errorhandler(500)
    def app_exception_handler(e):
        return "app-error"

    @app.route("/error")
    def app_test():
        raise InternalServerError()

    app.register_blueprint(bp, url_prefix="/bp")

    c = app.test_client()

    assert c.get("/error").data == b"app-error"
    assert c.get("/bp/error").data == b"bp-error"

Subdomains

Frequently Asked Questions

What does test_error_handler_blueprint() do?
test_error_handler_blueprint() is a function in the flask codebase, defined in tests/test_user_error_handler.py.
Where is test_error_handler_blueprint() defined?
test_error_handler_blueprint() is defined in tests/test_user_error_handler.py at line 136.

Analyze Your Own Codebase

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

Try Supermodel Free