code: def test_doctest_set_trace_quit(self, pytester: Pytester) -> None:
      p1 = pytester.makepyfile(
          """
              def function_1():
                  '''
                  >>> __import__('pdb').set_trace()
                  '''
          """
      )
      # NOTE: does not use pytest.set_trace, but Python's patched pdb,
      #       therefore "-s" is required.
      child = pytester.spawn_pytest(
          "--doctest-modules --pdb -s %s" % p1
      )
      child.expect("Pdb")
      child.sendline("q")
      rest = child.read().decode("utf8")
  
      assert "! _pytest.outcomes.Exit: Quitting debugger !" in rest
      assert "= no tests ran in" in rest
      assert "BdbQuit" not in rest
      assert "UNEXPECTED EXCEPTION" not in rest
  
imports: import os
  import sys
  from typing import List
  import _pytest._code
  import pytest
  from _pytest.debugging import _validate_usepdb_cls
  from _pytest.monkeypatch import MonkeyPatch
  from _pytest.pytester import Pytester
label_desc: Use image node_id 26 for calling the TestPDB obj's underlying member method code with example usage: obj.test_doctest_set_trace_quit(pytester) without return types