code: def test_bad_init_gamma(gamma):
      """Test creating an Image with a bad gamma value."""
      with TestingCanvas(size=(100, 50)) as c:
          pytest.raises(
              (TypeError, ValueError),
              Image,
              gamma=gamma,
              parent=c.scene,
          )
  
file_path: vispy/vispy/visuals/tests/test_image.py
imports: from unittest import mock
  from vispy.scene import Image, PanZoomCamera
  from vispy.testing import requires_application, TestingCanvas, run_tests_if_main, IS_CI
  from vispy.testing.image_tester import assert_image_approved, downsample
  import numpy
  import pytest
  from vispy.testing.rendered_array_tester import compare_render, max_for_dtype
label_desc: Use image node_id 2 for calling a global function with example usage: test_bad_init_gamma(gamma) without return types