def cwd_at(path):
 def decorator(func):
  @functools.wraps(func)
  def wrapper(*args, **kwds):
   try:
    oldcwd = os.getcwd()
    repo_root = os.path.dirname(test_dir)
    os.chdir(os.path.join(repo_root, path))
    return func(*args, **kwds)
   finally:
    os.chdir(oldcwd)
  return wrapper
 return decorator

def cwd_at ( path ) : def decorator ( func ) : @ functools . wraps ( func ) def wrapper ( * args , ** kwds ) : try : oldcwd = os . getcwd ( ) repo_root = os . path . dirname ( test_dir ) os . chdir ( os . path . join ( repo_root , path ) ) return func ( * args , ** kwds ) finally : os . chdir ( oldcwd ) return wrapper return decorator
decorator to run function at path .