code: def test_math_compat(app, status, warning):
      with warnings.catch_warnings(record=True):
          app.build(force_all=True)
          doctree = app.env.get_and_resolve_doctree(
              "index", app.builder
          )
  
          assert_node(
              doctree,
              [
                  nodes.document,
                  nodes.section,
                  (
                      nodes.title,
                      [nodes.section, (nodes.title, nodes.paragraph)],
                      nodes.section,
                  ),
              ],
          )
          assert_node(
              doctree[0][1][1],
              (
                  "Inline: ",
                  [nodes.math, "E=mc^2"],
                  "\nInline my math: ",
                  [nodes.math, "E = mc^2"],
              ),
          )
          assert_node(
              doctree[0][2],
              (
                  [nodes.title, "block"],
                  [nodes.math_block, "a^2+b^2=c^2\n\n"],
                  [nodes.paragraph, "Second math"],
                  [nodes.math_block, "e^{i\\pi}+1=0\n\n"],
                  [nodes.paragraph, "Multi math equations"],
                  [nodes.math_block, "E = mc^2"],
              ),
          )
  
imports: import re
  import shutil
  import subprocess
  import warnings
  import pytest
  from docutils import nodes
  from sphinx.ext.mathjax import MATHJAX_URL
  from sphinx.testing.util import assert_node
label_desc: Use image node_id 13 for calling a global function with example usage: test_math_compat(app, status, warning) without return types