code: def test_malformed_header(afm_data, caplog):
      fh = BytesIO(afm_data)
      with caplog.at_level(logging.ERROR):
          _afm._parse_header(fh)
  
      assert len(caplog.records) == 1
  
file_path: matplotlib/lib/matplotlib/tests/test_afm.py
imports: from io import BytesIO
  import pytest
  import logging
  from matplotlib import _afm
  from matplotlib import font_manager
label_desc: Use image node_id 7 for calling a global function with example usage: test_malformed_header(afm_data, caplog) without return types