code: def minimal_app_for_api():
      @dont_initialize_flask_app_submodules(
          skip_all_except=[
              "init_appbuilder",
              "init_api_experimental_auth",
              "init_api_connexion",
              "init_api_error_handlers",
              "init_airflow_session_interface",
              "init_appbuilder_views",
          ]
      )
      def factory():
          with conf_vars(
              {
                  (
                      "api",
                      "auth_backends",
                  ): "tests.test_utils.remote_user_api_auth_backend"
              }
          ):
              return app.create_app(
                  testing=True, config={"WTF_CSRF_ENABLED": False}
              )  # type:ignore
  
      return factory()
  
file_path: airflow/tests/api_connexion/conftest.py
imports: from __future__ import annotations
  import warnings
  import pytest
  from airflow.exceptions import RemovedInAirflow3Warning
  from airflow.www import app
  from tests.test_utils.config import conf_vars
  from tests.test_utils.decorators import dont_initialize_flask_app_submodules
label_desc: Use image node_id 1 for calling a global function with example usage: minimal_app_for_api() and returns: factory, app