code: def test_pdb_print_captured_stdout_and_stderr(
      self, pytester: Pytester
  ) -> None:
      p1 = pytester.makepyfile(
          """
              def test_1():
                  import sys
                  sys.stderr.write("get\\x20rekt")
                  print("get\\x20rekt")
                  assert False
  
              def test_not_called_due_to_quit():
                  pass
          """
      )
      child = pytester.spawn_pytest("--pdb %s" % p1)
      child.expect("captured stdout")
      child.expect("get rekt")
      child.expect("captured stderr")
      child.expect("get rekt")
      child.expect("traceback")
      child.expect("def test_1")
      child.expect("Pdb")
      child.sendeof()
      rest = child.read().decode("utf8")
      assert "Exit: Quitting debugger" in rest
      assert "= 1 failed in" in rest
      assert "def test_1" not in rest
      assert "get rekt" not in rest
      self.flush(child)
  
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 11 for calling the TestPDB obj's underlying member method code with example usage: obj.test_pdb_print_captured_stdout_and_stderr(pytester) without return types