change the HOME for git commands to avoid using the user git configuration

This commit is contained in:
Bernat Gabor 2017-10-27 11:01:52 +01:00
parent 9e193f7fc8
commit 5b472b30eb
No known key found for this signature in database
GPG key ID: 25F70E3BB8B17899
2 changed files with 10 additions and 5 deletions

View file

@ -34,7 +34,7 @@ def test_get_root_not_git_dir(tempdir_factory):
git.get_root()
def test_get_staged_files_deleted(tempdir_factory):
def test_get_staged_files_deleted(tempdir_factory, setup_git):
path = git_dir(tempdir_factory)
with cwd(path):
open('test', 'a').close()
@ -114,7 +114,7 @@ def test_parse_merge_msg_for_conflicts(input, expected_output):
assert ret == expected_output
def test_get_changed_files(in_tmpdir):
def test_get_changed_files(in_tmpdir, setup_git):
cmd_output('git', 'init', '.')
cmd_output('git', 'commit', '--allow-empty', '-m', 'initial commit')
open('a.txt', 'a').close()
@ -143,7 +143,7 @@ def test_zsplit(s, expected):
@pytest.fixture
def non_ascii_repo(tmpdir):
def non_ascii_repo(tmpdir, setup_git):
repo = tmpdir.join('repo').ensure_dir()
with repo.as_cwd():
cmd_output('git', 'init', '.')