def ifPlatformSupported(f):
 @wraps(f)
 def wrapper(self, *args, **kwargs):
  supported = (platform.getType() == 'posix')
  if supported:
   return f(self, *args, **kwargs)
  else:
   e = self.assertRaises((NotImplementedError, SkipTest, self.failureException), f, self, *args, **kwargs)
   if isinstance(e, NotImplementedError):
    self.assertTrue(str(e).startswith('isRunning is not implemented on '))
 return wrapper

def ifPlatformSupported ( f ) : @ wraps ( f ) def wrapper ( self , * args , ** kwargs ) : supported = ( platform . getType ( ) == 'posix' ) if supported : return f ( self , * args , ** kwargs ) else : e = self . assertRaises ( ( NotImplementedError , SkipTest , self . failureException ) , f , self , * args , ** kwargs ) if isinstance ( e , NotImplementedError ) : self . assertTrue ( str ( e ) . startswith ( 'isRunning is not implemented on ' ) ) return wrapper
decorator for tests that are not expected to work on all platforms .