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

Function test_attr_hasmarkup

testing/io/test_terminalwriter.py:158–167  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

156
157@pytest.mark.skipif(sys.platform == "win32", reason="win32 has no native ansi")
158def test_attr_hasmarkup() -> None:
159 file = io.StringIO()
160 tw = terminalwriter.TerminalWriter(file)
161 assert not tw.hasmarkup
162 tw.hasmarkup = True
163 tw.line("hello", bold=True)
164 s = file.getvalue()
165 assert len(s) > len("hello\n")
166 assert "\x1b[1m" in s
167 assert "\x1b[0m" in s
168
169
170def assert_color(expected: bool, default: bool | None = None) -> None:

Callers

nothing calls this directly

Calls 2

lineMethod · 0.95
getvalueMethod · 0.45

Tested by

no test coverage detected