()
| 156 | |
| 157 | @pytest.mark.skipif(sys.platform == "win32", reason="win32 has no native ansi") |
| 158 | def 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 | |
| 170 | def assert_color(expected: bool, default: bool | None = None) -> None: |