code: def test_attr_hasmarkup() -> None:
      file = io.StringIO()
      tw = terminalwriter.TerminalWriter(file)
      assert not tw.hasmarkup
      tw.hasmarkup = True
      tw.line("hello", bold=True)
      s = file.getvalue()
      assert len(s) > len("hello\n")
      assert "\x1b[1m" in s
      assert "\x1b[0m" in s
  
imports: import io
  import os
  import re
  import shutil
  import sys
  from pathlib import Path
  from typing import Generator
  from typing import Optional
  from unittest import mock
  import pytest
  from _pytest._io import terminalwriter
  from _pytest.monkeypatch import MonkeyPatch
label_desc: Use image node_id 6 for calling a global function with example usage: test_attr_hasmarkup() without return types