MCPcopy
hub / github.com/pytest-dev/pytest / __init__

Method __init__

src/_pytest/_io/terminalwriter.py:75–90  ·  view source on GitHub ↗
(self, file: TextIO | None = None)

Source from the content-addressed store, hash-verified

73 )
74
75 def __init__(self, file: TextIO | None = None) -> None:
76 if file is None:
77 file = sys.stdout
78 if hasattr(file, "isatty") and file.isatty() and sys.platform == "win32":
79 try:
80 import colorama
81 except ImportError:
82 pass
83 else:
84 file = colorama.AnsiToWin32(file).stream
85 assert file is not None
86 self._file = file
87 self.hasmarkup = should_do_markup(file)
88 self._current_line = ""
89 self._terminal_width: int | None = None
90 self.code_highlight = True
91
92 @property
93 def fullwidth(self) -> int:

Callers

nothing calls this directly

Calls 2

should_do_markupFunction · 0.85
isattyMethod · 0.45

Tested by

no test coverage detected