class_docstr: Test how very generic handlers are dispatched to.
class_docstr_tok: ["Test","how","very","generic","handlers","are","dispatched","to","."]
docstr: ``InternalServerError`` and ``500`` are aliases, they should
  have the same behavior. Both should only receive
  ``InternalServerError``, which might wrap another error.
docstr_tok: ["``","InternalServerError","``","and","``","500","``","are","aliases",",","they","should","have","the","same","behavior",".","Both","should","only","receive","``","InternalServerError","``",",","which","might","wrap","another","error","."]
code: 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"
  
file_path: flask/tests/test_user_error_handler.py
imports: import pytest
  from werkzeug.exceptions import Forbidden
  from werkzeug.exceptions import HTTPException
  from werkzeug.exceptions import InternalServerError
  from werkzeug.exceptions import NotFound
  import flask
label_desc: Use image node_id 3 for calling the TestGenericHandlers obj's underlying member method code with example usage: obj.test_handle_class_or_code(app, client, to_handle) and returns: self