Skip to content

Commit b018325

Browse files
committed
use monkeypatch in conftest
1 parent 242866e commit b018325

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

test/conftest.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,6 @@ def xtl_clone(git2cpp_path):
3131
subprocess.run(cleanup_cmd, capture_output=True, cwd = clone_working_dir, text=True)
3232

3333
@pytest.fixture
34-
def git_config(git2cpp_path):
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")
39-
40-
yield
41-
42-
os.remove("test/data/.gitconfig")
34+
def git_config(git2cpp_path, monkeypatch):
35+
monkeypatch.setenv("GIT_AUTHOR_NAME", "Jane Doe")
36+
monkeypatch.setenv("GIT_AUTHOR_EMAIL", "jane.doe@blabla.com")

0 commit comments

Comments
 (0)