def require_module(module):
 def check_require_module(f):
  try:
   __import__(module)
   return f
  except ImportError:
   def new_f(self, *args, **kwargs):
    self.skipTest(('%s can not be imported.' % module))
   new_f.__name__ = f.__name__
   return new_f
 return check_require_module

def require_module ( module ) : def check_require_module ( f ) : try : __import__ ( module ) return f except ImportError : def new_f ( self , * args , ** kwargs ) : self . skipTest ( ( '%s can not be imported.' % module ) ) new_f . __name__ = f . __name__ return new_f return check_require_module
check if the given module is loaded .