code: def test_build(app, status, warning):
      app.build(force_all=True)
  
      py_undoc = (app.outdir / "python.txt").read_text(encoding="utf8")
      assert py_undoc.startswith(
          "Undocumented Python objects\n"
          "===========================\n"
      )
      assert "autodoc_target\n--------------\n" in py_undoc
      assert " * Class -- missing methods:\n" in py_undoc
      assert " * raises\n" in py_undoc
      assert " * function\n" not in py_undoc  # these two are documented
      assert " * Class\n" not in py_undoc  # in autodoc.txt
  
      assert (
          " * mod -- No module named 'mod'" in py_undoc
      )  # in the "failed import" section
  
      assert "undocumented  py" not in status.getvalue()
  
      c_undoc = (app.outdir / "c.txt").read_text(encoding="utf8")
      assert c_undoc.startswith(
          "Undocumented C API elements\n"
          "===========================\n"
      )
      assert "api.h" in c_undoc
      assert " * Py_SphinxTest" in c_undoc
  
      undoc_py, undoc_c, py_undocumented, py_documented = pickle.loads(
          (app.outdir / "undoc.pickle").read_bytes()
      )
      assert len(undoc_c) == 1
      # the key is the full path to the header file, which isn't testable
      assert list(undoc_c.values())[0] == {
          ("function", "Py_SphinxTest")
      }
  
      assert "autodoc_target" in undoc_py
      assert "funcs" in undoc_py["autodoc_target"]
      assert "raises" in undoc_py["autodoc_target"]["funcs"]
      assert "classes" in undoc_py["autodoc_target"]
      assert "Class" in undoc_py["autodoc_target"]["classes"]
      assert (
          "undocmeth" in undoc_py["autodoc_target"]["classes"]["Class"]
      )
  
      assert "undocumented  c" not in status.getvalue()
  
imports: import pickle
  import pytest
label_desc: Use image node_id 1 for calling a global function with example usage: test_build(app, status, warning) without return types