code: def test_incorrect_mode():
      im = hopper("RGB")
      mop = ImageMorph.MorphOp(op_name="erosion8")
  
      with pytest.raises(ValueError) as e:
          mop.apply(im)
      assert str(e.value) == "Image mode must be L"
      with pytest.raises(ValueError) as e:
          mop.match(im)
      assert str(e.value) == "Image mode must be L"
      with pytest.raises(ValueError) as e:
          mop.get_on_pixels(im)
      assert str(e.value) == "Image mode must be L"
  
imports: import pytest
  from PIL import Image, ImageMorph, _imagingmorph
  from .helper import assert_image_equal_tofile, hopper
label_desc: Use image node_id 17 for calling a global function with example usage: test_incorrect_mode() without return types