diff --git a/src/_pytest/debugging.py b/src/_pytest/debugging.py index 69ec58c5b..51ee6be0f 100644 --- a/src/_pytest/debugging.py +++ b/src/_pytest/debugging.py @@ -352,7 +352,13 @@ def _enter_pdb( ("stderr", rep.capstderr), ("log", rep.caplog), ): - if showcapture in (sectionname, "all") and content: + if ( + showcapture in (sectionname, "all") + or ( + showcapture == "stdio" + and ("stdout" in sectionname or "stderr" in sectionname) + ) + ) and content: tw.sep(">", "captured " + sectionname) if content[-1:] == "\n": content = content[:-1]