class_docstr: A subclass of :class:`Sphinx` that runs on the test root, with some
  better default values for the initialization parameters.
code: def __init__(
      self,
      buildername: str = "html",
      srcdir: Path | None = None,
      builddir: Path | None = None,
      freshenv: bool = False,
      confoverrides: dict | None = None,
      status: IO | None = None,
      warning: IO | None = None,
      tags: list[str] | None = None,
      docutils_conf: str | None = None,
      parallel: int = 0,
  ) -> None:
      assert srcdir is not None
  
      self.docutils_conf_path = srcdir / "docutils.conf"
      if docutils_conf is not None:
          self.docutils_conf_path.write_text(
              docutils_conf, encoding="utf8"
          )
  
      if builddir is None:
          builddir = srcdir / "_build"
  
      confdir = srcdir
      outdir = builddir.joinpath(buildername)
      outdir.mkdir(parents=True, exist_ok=True)
      doctreedir = builddir.joinpath("doctrees")
      doctreedir.mkdir(parents=True, exist_ok=True)
      if confoverrides is None:
          confoverrides = {}
  
      self._saved_path = sys.path.copy()
  
      try:
          super().__init__(
              srcdir,
              confdir,
              outdir,
              doctreedir,
              buildername,
              confoverrides,
              status,
              warning,
              freshenv,
              warningiserror=False,
              tags=tags,
              parallel=parallel,
          )
      except Exception:
          self.cleanup()
          raise
  
imports: from __future__ import annotations
  import contextlib
  import os
  import re
  import sys
  import warnings
  from typing import IO, TYPE_CHECKING, Any
  from xml.etree import ElementTree
  from docutils import nodes
  from sphinx import application
label_desc: Use image node_id 1 to create a new SphinxTestApp object from inherited base classes: application with example: obj = SphinxTestApp(buildername, srcdir, builddir, freshenv, confoverrides, status, warning, tags, docutils_conf, parallel)