From 3c14dd7f55dbc14dabdff4ecf5246ba0f4501e8f Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Tue, 22 Oct 2019 02:01:50 +0200 Subject: [PATCH] capture: improve message with DontReadFromInput's IOError Ref: https://github.com/pytest-dev/pytest/pull/4996#issuecomment-479686487 --- src/_pytest/capture.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/_pytest/capture.py b/src/_pytest/capture.py index e4e58b32c..2877f2215 100644 --- a/src/_pytest/capture.py +++ b/src/_pytest/capture.py @@ -703,7 +703,9 @@ class DontReadFromInput: encoding = None def read(self, *args): - raise IOError("reading from stdin while output is captured") + raise IOError( + "pytest: reading from stdin while output is captured! Consider using `-s`." + ) readline = read readlines = read