class_docstr: Pseudo PDB that defers to the real pdb. 
class_docstr_tok: ["Pseudo","PDB","that","defers","to","the","real","pdb","."]
code: def _get_pdb_wrapper_class(cls, pdb_cls, capman):
      import _pytest.config
  
      class PytestPdbWrapper(pdb_cls, object):
          _pytest_capman = capman
          _continued = False
  
          def do_debug(self, arg):
              cls._recursive_debug += 1
              ret = super(PytestPdbWrapper, self).do_debug(arg)
              cls._recursive_debug -= 1
              return ret
  
          def do_continue(self, arg):
              ret = super(PytestPdbWrapper, self).do_continue(arg)
              if cls._recursive_debug == 0:
                  tw = _pytest.config.create_terminal_writer(
                      cls._config
                  )
                  tw.line()
  
                  capman = self._pytest_capman
                  capturing = pytestPDB._is_capturing(capman)
                  if capturing:
                      if capturing == "global":
                          tw.sep(
                              ">", "PDB continue (IO-capturing resumed)"
                          )
                      else:
                          tw.sep(
                              ">",
                              "PDB continue (IO-capturing resumed for %s)"
                              % capturing,
                          )
                      capman.resume()
                  else:
                      tw.sep(">", "PDB continue")
              cls._pluginmanager.hook.pytest_leave_pdb(
                  config=cls._config, pdb=self
              )
              self._continued = True
              return ret
  
          do_c = do_cont = do_continue
  
          def do_quit(self, arg):
              """Raise Exit outcome when quit command is used in pdb.
  
              This is a bit of a hack - it would be better if BdbQuit
              could be handled, but this would require to wrap the
              whole pytest run, and adjust the report etc.
              """
              ret = super(PytestPdbWrapper, self).do_quit(arg)
  
              if cls._recursive_debug == 0:
                  outcomes.exit("Quitting debugger")
  
              return ret
  
          do_q = do_quit
          do_exit = do_quit
  
          def setup(self, f, tb):
              """Suspend on setup().
  
              Needed after do_continue resumed, and entering another
              breakpoint again.
              """
              ret = super(PytestPdbWrapper, self).setup(f, tb)
              if not ret and self._continued:
                  # pdb.setup() returns True if the command wants to exit
                  # from the interaction: do not suspend capturing then.
                  if self._pytest_capman:
                      self._pytest_capman.suspend_global_capture(
                          in_=True
                      )
              return ret
  
          def get_stack(self, f, t):
              stack, i = super(PytestPdbWrapper, self).get_stack(f, t)
              if f is None:
                  # Find last non-hidden frame.
                  i = max(0, len(stack) - 1)
                  while i and stack[i][0].f_locals.get(
                      "__tracebackhide__", False
                  ):
                      i -= 1
              return stack, i
  
      return PytestPdbWrapper
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  import argparse
  import pdb
  import sys
  from doctest import UnexpectedException
  from _pytest import outcomes
  from _pytest.config import hookimpl
  from _pytest.config.exceptions import UsageError
label_desc: Use image node_id 3 for calling the pytestPDB obj's underlying member method code with example usage: obj._get_pdb_wrapper_class(cls, pdb_cls, capman) and returns: PytestPdbWrapper, ret, ret, ret, ret, stack,  i