Skip to content

Commit 8316d43

Browse files
authored
Merge pull request #6028 from blueyed/DontReadFromInput-msg
capture: improve message with DontReadFromInput's IOError
2 parents 7a2d2d8 + 3c14dd7 commit 8316d43

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
@@ -696,7 +696,9 @@ class DontReadFromInput:
696696
encoding = None
697697

698698
def read(self, *args):
699-
raise IOError("reading from stdin while output is captured")
699+
raise IOError(
700+
"pytest: reading from stdin while output is captured! Consider using `-s`."
701+
)
700702

701703
readline = read
702704
readlines = read

0 commit comments

Comments
 (0)