Skip to content

Commit 242866e

Browse files
committed
edit conftest
1 parent 0a1396f commit 242866e

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

test/conftest.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from pathlib import Path
33
import pytest
44
import subprocess
5+
from genericpath import exists
56

67

78
# Fixture to run test in current tmp_path
@@ -31,9 +32,11 @@ def xtl_clone(git2cpp_path):
3132

3233
@pytest.fixture
3334
def git_config(git2cpp_path):
34-
with open("test/data/.gitconfig", "a") as f:
35-
f.write("[user]\n name = Jane Doe\n email = jane.doe@blabla.com")
35+
gitconfig_path = "~/.gitconfig"
36+
if not(os.path.isfile(gitconfig_path)):
37+
with open("~/.gitconfig", "a") as f:
38+
f.write("[user]\n name = Jane Doe\n email = jane.doe@blabla.com")
3639

37-
yield
40+
yield
3841

39-
os.remove("test/data/.gitconfig")
42+
os.remove("test/data/.gitconfig")

0 commit comments

Comments
 (0)