MCPcopy Create free account
hub / github.com/pytest-dev/pytest / DontReadFromInput

Class DontReadFromInput

src/_pytest/capture.py:188–214  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

186
187
188class DontReadFromInput:
189 encoding = None
190
191 def read(self, *args):
192 raise OSError(
193 "pytest: reading from stdin while output is captured! Consider using `-s`."
194 )
195
196 readline = read
197 readlines = read
198 __next__ = read
199
200 def __iter__(self):
201 return self
202
203 def fileno(self) -> int:
204 raise UnsupportedOperation("redirected stdin is pseudofile, has no fileno()")
205
206 def isatty(self) -> bool:
207 return False
208
209 def close(self) -> None:
210 pass
211
212 @property
213 def buffer(self):
214 return self
215
216
217# Capture classes.

Callers 2

test_dontreadfrominputFunction · 0.90
__init__Method · 0.85

Calls

no outgoing calls

Tested by 1

test_dontreadfrominputFunction · 0.72