code: def test_photoimage():
      for mode in TK_MODES:
          # test as image:
          im = hopper(mode)
  
          # this should not crash
          im_tk = ImageTk.PhotoImage(im)
  
          assert im_tk.width() == im.width
          assert im_tk.height() == im.height
  
          reloaded = ImageTk.getimage(im_tk)
          assert_image_equal(reloaded, im.convert("RGBA"))
  
imports: import pytest
  from PIL import Image
  from .helper import assert_image_equal, hopper
label_desc: Use image node_id 3 for calling a global function with example usage: test_photoimage() without return types