Skip to content

Commit 0a1396f

Browse files
committed
test with .gitconfig
1 parent 9951eba commit 0a1396f

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

test/conftest.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,12 @@ def xtl_clone(git2cpp_path):
2828

2929
cleanup_cmd = ['rm', '-rf', 'xtl']
3030
subprocess.run(cleanup_cmd, capture_output=True, cwd = clone_working_dir, text=True)
31+
32+
@pytest.fixture
33+
def git_config(git2cpp_path):
34+
with open("test/data/.gitconfig", "a") as f:
35+
f.write("[user]\n name = Jane Doe\n email = [email protected]")
36+
37+
yield
38+
39+
os.remove("test/data/.gitconfig")

test/test_commit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
working_dir = 'test/data/xtl'
88

99
@pytest.mark.parametrize("all_flag", ["", "-A", "--all", "--no-ignore-removal"])
10-
def test_commit(xtl_clone, git2cpp_path, all_flag):
10+
def test_commit(xtl_clone, git_config, git2cpp_path, all_flag):
1111
with open("./test/data/xtl/mook_file.txt", "x"):
1212
pass
1313

0 commit comments

Comments
 (0)