code: def test_invalid_file():
      invalid_file = "Tests/images/flower.jpg"
  
      with pytest.raises(SyntaxError):
          CurImagePlugin.CurImageFile(invalid_file)
  
      no_cursors_file = "Tests/images/no_cursors.cur"
  
      cur = CurImagePlugin.CurImageFile(TEST_FILE)
      cur.fp.close()
      with open(no_cursors_file, "rb") as cur.fp:
          with pytest.raises(TypeError):
              cur._open()
  
imports: from __future__ import annotations
  import pytest
  from PIL import CurImagePlugin, Image
label_desc: Use image node_id 2 for calling a global function with example usage: test_invalid_file() without return types