def skipUnlessHasGit(f):
    @wraps(f)
    def _decorator():
        try:
            sh.git(version=True, _out='/dev/null')
            return f()
        except sh.CommandNotFound:
            return unittest.skip("Git is not installed")
    return _decorator
Setup import hooks and global streams.
dataset/ETHPy150Open Sheeprider/BitBucket-api/bitbucket/tests/private/repository.py/skipUnlessHasGit--crossover with--dataset/ETHPy150Open neovim/python-client/neovim/plugin/script_host.py/ScriptHost.setup