code: def app(
      test_params: dict,
      app_params: tuple[dict, dict],
      make_app: Callable,
      shared_result: SharedResult,
  ) -> Generator[SphinxTestApp, None, None]:
      """
      Provides the 'sphinx.application.Sphinx' object
      """
      args, kwargs = app_params
      app_ = make_app(*args, **kwargs)
      yield app_
  
      print("# testroot:", kwargs.get("testroot", "root"))
      print("# builder:", app_.builder.name)
      print("# srcdir:", app_.srcdir)
      print("# outdir:", app_.outdir)
      print("# status:", "\n" + app_._status.getvalue())
      print("# warning:", "\n" + app_._warning.getvalue())
  
      if test_params["shared_result"]:
          shared_result.store(test_params["shared_result"], app_)
  
imports: from __future__ import annotations
  import shutil
  import subprocess
  import sys
  from collections import namedtuple
  from io import StringIO
  from typing import TYPE_CHECKING, Any, Callable
  import pytest
  from sphinx.testing.util import SphinxTestApp, SphinxTestAppWrapperForSkipBuilding
label_desc: Use image node_id 5 for calling a global function with example usage: app(test_params, app_params, make_app, shared_result) without return types