Skip to content
Prev Previous commit
Next Next commit
use monkeypatch in conftest
  • Loading branch information
SandrineP committed Aug 4, 2025
commit b0183250e9978d15b5bdd803e024cf0f2fa899de
12 changes: 3 additions & 9 deletions test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,6 @@ def xtl_clone(git2cpp_path):
subprocess.run(cleanup_cmd, capture_output=True, cwd = clone_working_dir, text=True)

@pytest.fixture
def git_config(git2cpp_path):
gitconfig_path = "~/.gitconfig"
if not(os.path.isfile(gitconfig_path)):
with open("~/.gitconfig", "a") as f:
f.write("[user]\n name = Jane Doe\n email = jane.doe@blabla.com")

yield

os.remove("test/data/.gitconfig")
def git_config(git2cpp_path, monkeypatch):
Comment thread
ianthomas23 marked this conversation as resolved.
Outdated
monkeypatch.setenv("GIT_AUTHOR_NAME", "Jane Doe")
monkeypatch.setenv("GIT_AUTHOR_EMAIL", "jane.doe@blabla.com")
Loading