Home / Function/ test_handle_class_or_code() — flask Function Reference

test_handle_class_or_code() — flask Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  5132b7d1_5ccf_846d_45dc_9aab3e67c6af["test_handle_class_or_code()"]
  d43f613b_526f_83b2_b03e_180d5f56de23["TestGenericHandlers"]
  5132b7d1_5ccf_846d_45dc_9aab3e67c6af -->|defined in| d43f613b_526f_83b2_b03e_180d5f56de23
  83c9c51e_e291_f343_62c6_349a614281ff["report_error()"]
  5132b7d1_5ccf_846d_45dc_9aab3e67c6af -->|calls| 83c9c51e_e291_f343_62c6_349a614281ff
  style 5132b7d1_5ccf_846d_45dc_9aab3e67c6af fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_user_error_handler.py lines 253–267

    def test_handle_class_or_code(self, app, client, to_handle):
        """``InternalServerError`` and ``500`` are aliases, they should
        have the same behavior. Both should only receive
        ``InternalServerError``, which might wrap another error.
        """

        @app.errorhandler(to_handle)
        def handle_500(e):
            assert isinstance(e, InternalServerError)
            return self.report_error(e)

        assert client.get("/custom").data == b"wrapped Custom"
        assert client.get("/error").data == b"wrapped KeyError"
        assert client.get("/abort").data == b"direct InternalServerError"
        assert client.get("/raise").data == b"direct InternalServerError"

Subdomains

Frequently Asked Questions

What does test_handle_class_or_code() do?
test_handle_class_or_code() is a function in the flask codebase, defined in tests/test_user_error_handler.py.
Where is test_handle_class_or_code() defined?
test_handle_class_or_code() is defined in tests/test_user_error_handler.py at line 253.
What does test_handle_class_or_code() call?
test_handle_class_or_code() calls 1 function(s): report_error.

Analyze Your Own Codebase

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

Try Supermodel Free