Skip to content

Commit

Permalink
Allow DontReadFromInput to produce iterator without error. Fixes #3314.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Mar 16, 2018
1 parent 3c3fc3b commit 2f47624
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion _pytest/capture.py
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,10 @@ def read(self, *args):
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, "
Expand Down

0 comments on commit 2f47624

Please sign in to comment.