@simple_decorator
def online_only(test_func):
 def _test(*args, **kwargs):
  if (not is_online()):
   raise nose.SkipTest(u'Host is not online')
  return test_func(*args, **kwargs)
 return _test

@ simple_decorator def online_only ( test_func ) : def _test ( * args , ** kwargs ) : if ( not is_online ( ) ) : raise nose . SkipTest ( u'Host is not online' ) return test_func ( * args , ** kwargs ) return _test
decorate a test to check online state .