MCPcopy Index your code
hub / github.com/pytest-dev/pytest / EncodedFile

Class EncodedFile

src/_pytest/capture.py:186–200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

184
185
186class EncodedFile(io.TextIOWrapper):
187 __slots__ = ()
188
189 @property
190 def name(self) -> str:
191 # Ensure that file.name is a string. Workaround for a Python bug
192 # fixed in >=3.7.4: https://bugs.python.org/issue36015
193 return repr(self.buffer)
194
195 @property
196 def mode(self) -> str:
197 # TextIOWrapper doesn't expose a mode, but at least some of our
198 # tests check it.
199 assert hasattr(self.buffer, "mode")
200 return cast(str, self.buffer.mode.replace("b", ""))
201
202
203class CaptureIO(io.TextIOWrapper):

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…