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

:type path: str
:arg path: relative path from repository root (e.g., 'pyqode' or 'test').