code: def test_subpackage_in_toc(make_app, apidoc):
      """Make sure that empty subpackages with non-empty subpackages in them
      are not skipped (issue #4520)
      """
      outdir = apidoc.outdir
      assert (outdir / "conf.py").is_file()
  
      assert (outdir / "parent.rst").is_file()
      with open(outdir / "parent.rst", encoding="utf-8") as f:
          parent = f.read()
      assert "parent.child" in parent
  
      assert (outdir / "parent.child.rst").is_file()
      with open(outdir / "parent.child.rst", encoding="utf-8") as f:
          parent_child = f.read()
      assert "parent.child.foo" in parent_child
  
      assert (outdir / "parent.child.foo.rst").is_file()
  
imports: import os.path
  from collections import namedtuple
  import pytest
  import sphinx.ext.apidoc
  from sphinx.ext.apidoc import main
label_desc: Use image node_id 18 for calling a global function with example usage: test_subpackage_in_toc(make_app, apidoc) without return types