code: def skip_on(etype):
      from functools import wraps
  
      def skip_on2(test):
          @wraps(test)
          def execute(*args, **kwargs):
              try:
                  test(*args, **kwargs)
              except Exception as e:
                  if isinstance(e, etype):
                      pytest.skip("Missing dependency")
                  raise
  
          return execute
  
      return skip_on2
  
file_path: mahotas/mahotas/tests/test_io.py
imports: import numpy
  from mahotas.io import error_imread, error_imsave
  from os import path
  import mahotas
  import pytest
label_desc: Use image node_id 1 for calling a global function with example usage: skip_on(etype) and returns: skip_on2, execute