def skipIfNoExecutable(executable):
 with open(os.devnull, u'w') as fnull:
  try:
   res = subprocess.call(executable, stdout=fnull, stderr=fnull)
  except OSError:
   res = None
 if (res is None):
  return unittest.skip(u'{0} executable not found'.format(executable))
 return (lambda func: func)

def skipIfNoExecutable ( executable ) : with open ( os . devnull , u'w' ) as fnull : try : res = subprocess . call ( executable , stdout = fnull , stderr = fnull ) except OSError : res = None if ( res is None ) : return unittest . skip ( u'{0} executable not found' . format ( executable ) ) return ( lambda func : func )
skip test if executable is not found tries to run executable with subprocess to make sure its in the path .