code: def test_AxisItem_label_visibility():
      """Test the visibility of the axis item using `setLabel`"""
      axis = pg.AxisItem("left")
      assert axis.labelText == ""
      assert axis.labelUnits == ""
      assert not axis.label.isVisible()
      axis.setLabel(text="Position", units="mm")
      assert axis.labelText == "Position"
      assert axis.labelUnits == "mm"
      assert axis.label.isVisible()
      # XXX: `None` is converted to empty strings.
      axis.setLabel(text=None, units=None)
      assert axis.labelText == ""
      assert axis.labelUnits == ""
      assert not axis.label.isVisible()
      axis.setLabel(text="Current", units=None)
      assert axis.labelText == "Current"
      assert axis.labelUnits == ""
      assert axis.label.isVisible()
      axis.setLabel(text=None, units=None)
      assert not axis.label.isVisible()
      axis.setLabel(text="", units="V")
      assert axis.labelText == ""
      assert axis.labelUnits == "V"
      assert axis.label.isVisible()
  
file_path: pyqtgraph/tests/graphicsItems/test_AxisItem.py
imports: from math import isclose
  import pytest
  import pyqtgraph
label_desc: Use image node_id 6 for calling a global function with example usage: test_AxisItem_label_visibility() without return types