code: def test_pytester_with_doctest(pytester: Pytester) -> None:
      """Check that pytester can be used within doctests.
  
      It used to use `request.function`, which is `None` with doctests.
      """
      pytester.makepyfile(
          **{
              "sub/t-doctest.py": """
          '''
          >>> import os
          >>> pytester = getfixture("pytester")
          >>> str(pytester.makepyfile("content")).replace(os.sep, '/')
          '.../basetemp/sub.t-doctest0/sub.py'
          '''
      """,
              "sub/__init__.py": "",
          }
      )
      result = pytester.runpytest(
          "-p", "pytester", "--doctest-modules", "sub/t-doctest.py"
      )
      assert result.ret == 0
  
imports: import os
  import subprocess
  import sys
  import time
  from types import ModuleType
  from typing import List
  import _pytest.pytester
  import pytest
  from _pytest.config import ExitCode
  from _pytest.config import PytestPluginManager
  from _pytest.monkeypatch import MonkeyPatch
  from _pytest.pytester import HookRecorder
  from _pytest.pytester import LineMatcher
  from _pytest.pytester import Pytester
  from _pytest.pytester import SysModulesSnapshot
  from _pytest.pytester import SysPathsSnapshot
label_desc: Use image node_id 4 for calling a global function with example usage: test_pytester_with_doctest(pytester) without return types