From ea5f445d12721ba28738ccf37bf601853c7f988b Mon Sep 17 00:00:00 2001 From: Eichel Choi Date: Wed, 6 Dec 2023 17:57:52 -0500 Subject: [PATCH] Used stdio for showcapture to show both stdout and stderr in debugging --- src/_pytest/debugging.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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]