We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c3d2c91 commit 89978e1Copy full SHA for 89978e1
tests/conftest.py
@@ -23,9 +23,14 @@ def git_sandbox(monkeypatch: pytest.MonkeyPatch, tmp_path: Path):
23
monkeypatch.delenv(var)
24
25
# Define a dedicated temporary git config
26
- monkeypatch.setenv("GIT_CONFIG_GLOBAL", str(tmp_path / "gitconfig"))
27
- cmd.run(f"git config --global user.name {SIGNER}")
28
- cmd.run(f"git config --global user.email {SIGNER_MAIL}")
+ gitconfig = tmp_path / ".git" / "config"
+ if not gitconfig.parent.exists():
+ gitconfig.parent.mkdir()
29
+ monkeypatch.setenv("GIT_CONFIG_GLOBAL", str(gitconfig))
30
+ r = cmd.run(f"git config --file {gitconfig} user.name {SIGNER}")
31
+ assert r.return_code == 0, r.err
32
+ r = cmd.run(f"git config --file {gitconfig} user.email {SIGNER_MAIL}")
33
34
35
36
@pytest.fixture(scope="function")
0 commit comments