code: def test_mesh_shading_change_from_none(shading):
      # Regression test for #2041: exception raised when changing the shading
      # mode with shading=None initially.
      size = (45, 40)
      with TestingCanvas(size=size) as c:
          v = c.central_widget.add_view(border_width=0)
          vertices = np.array(
              [(0, 0, 0), (0, 0, 1), (1, 0, 0)], dtype=float
          )
          faces = np.array([(0, 1, 2)])
          mesh = scene.visuals.Mesh(
              vertices=vertices, faces=faces, shading=None
          )
          v.add(mesh)
          c.render()
          # This below should not fail.
          mesh.shading = shading
          c.render()
  
file_path: vispy/vispy/visuals/tests/test_mesh.py
imports: import numpy
  from vispy import scene
  from vispy.color import Color
  from vispy.geometry import create_cube, create_sphere
  from vispy.testing import TestingCanvas, requires_application, run_tests_if_main, requires_pyopengl
  from vispy.visuals.filters import ShadingFilter, WireframeFilter
  from vispy.visuals.filters.mesh import _as_rgba
  import pytest
label_desc: Use image node_id 3 for calling a global function with example usage: test_mesh_shading_change_from_none(shading) without return types