code: def test_autodoc_typehints_both(app):
      with overwrite_file(
          app.srcdir / "index.rst",
          ".. autofunction:: target.typehints.incr\n"
          "\n"
          ".. autofunction:: target.typehints.tuple_args\n"
          "\n"
          ".. autofunction:: target.overload.sum\n",
      ):
          app.build()
      context = (app.outdir / "index.txt").read_text(encoding="utf8")
      assert (
          "target.typehints.incr(a: int, b: int = 1) -> int\n"
          "\n"
          "   Parameters:\n"
          "      * **a** (*int*) --\n"
          "\n"
          "      * **b** (*int*) --\n"
          "\n"
          "   Return type:\n"
          "      int\n" in context
      )
      assert (
          "target.typehints.tuple_args(x: tuple[int, int | str]) -> tuple[int, int]\n"
          "\n"
          "   Parameters:\n"
          "      **x** (*tuple**[**int**, **int** | **str**]*) --\n"
          "\n"
          "   Return type:\n"
          "      tuple[int, int]\n" in context
      )
  
      # Overloads still get displayed in the signature
      assert (
          "target.overload.sum(x: int, y: int = 0) -> int\n"
          "target.overload.sum(x: float, y: float = 0.0) -> float\n"
          "target.overload.sum(x: str, y: str = None) -> str\n"
          "\n"
          "   docstring\n" in context
      )
  
imports: import platform
  import sys
  from contextlib import contextmanager
  import pytest
  from sphinx.testing import restructuredtext
  from tests.test_extensions.test_ext_autodoc import do_autodoc
label_desc: Use image node_id 25 for calling a global function with example usage: test_autodoc_typehints_both(app) without return types