diff --git a/_pytest/capture.py b/_pytest/capture.py index 6e2139445..6545e6fa3 100644 --- a/_pytest/capture.py +++ b/_pytest/capture.py @@ -574,7 +574,10 @@ class DontReadFromInput(object): raise IOError("reading from stdin while output is captured") readline = read readlines = read - __iter__ = read + __next__ = read + + def __iter__(self): + return self def fileno(self): raise UnsupportedOperation("redirected stdin is pseudofile, "