Skip to content

Commit 3c14dd7

Browse files
committed
capture: improve message with DontReadFromInput's IOError
Ref: #4996 (comment)
1 parent 978c7ae commit 3c14dd7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/_pytest/capture.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,9 @@ class DontReadFromInput:
703703
encoding = None
704704

705705
def read(self, *args):
706-
raise IOError("reading from stdin while output is captured")
706+
raise IOError(
707+
"pytest: reading from stdin while output is captured! Consider using `-s`."
708+
)
707709

708710
readline = read
709711
readlines = read

0 commit comments

Comments
 (0)