code: def _fix_osmesa_gl_lib_if_testing():
      """
      This functions checks if we a running test with the osmesa backends and
      fix the GL library if needed.
  
      Since we have to fix the VISPY_GL_LIB *before* any import from the gl
      module, we have to run this here.
      Test discovery utilities (like pytest) will try to import modules
      before running tests, so we have to modify the GL lib really early.
      The other solution would be to setup pre-run hooks for the test utility,
      but there doesn't seem to be a standard way to do that (e.g. conftest.py
      for py.test)
      """
      test_name = os.getenv("_VISPY_TESTING_APP", None)
      if test_name == "osmesa":
          from ...util.osmesa_gl import fix_osmesa_gl_lib
  
          fix_osmesa_gl_lib()
  
file_path: vispy/vispy/gloo/gl/__init__.py
imports: from __future__ import division
  import os
  from ...util import config, logger
  from ._constants import *
  from ._proxy import BaseGLProxy
  from .None import gl2
label_desc: Use image node_id 7 for calling a global function with example usage: _fix_osmesa_gl_lib_if_testing() without return types