def skip_on_broken_permissions(test_method):
 @wraps(test_method)
 def wrapper(case, *args, **kwargs):
  test_file = FilePath(case.mktemp())
  test_file.touch()
  test_file.chmod(0)
  permissions = test_file.getPermissions()
  test_file.chmod(511)
  if (permissions != Permissions(0)):
   raise SkipTest("Can't run test on filesystem with broken permissions.")
  return test_method(case, *args, **kwargs)
 return wrapper

def skip_on_broken_permissions ( test_method ) : @ wraps ( test_method ) def wrapper ( case , * args , ** kwargs ) : test_file = FilePath ( case . mktemp ( ) ) test_file . touch ( ) test_file . chmod ( 0 ) permissions = test_file . getPermissions ( ) test_file . chmod ( 511 ) if ( permissions != Permissions ( 0 ) ) : raise SkipTest ( "Can't run test on filesystem with broken permissions." ) return test_method ( case , * args , ** kwargs ) return wrapper
skips the wrapped test when the temporary directory is on a filesystem with broken permissions .