def root_required(method): decorator = unittest.skipIf(os.getuid() != 0, 'root required') return decorator(method)