| 186 | |
| 187 | |
| 188 | class 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. |
no outgoing calls