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

Class EncodedFile

src/_pytest/capture.py:153–166  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

151
152
153class EncodedFile(io.TextIOWrapper):
154 __slots__ = ()
155
156 @property
157 def name(self) -> str:
158 # Ensure that file.name is a string. Workaround for a Python bug
159 # fixed in >=3.7.4: https://bugs.python.org/issue36015
160 return repr(self.buffer)
161
162 @property
163 def mode(self) -> str:
164 # TextIOWrapper doesn't expose a mode, but at least some of our
165 # tests check it.
166 return self.buffer.mode.replace("b", "")
167
168
169class CaptureIO(io.TextIOWrapper):

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected