--- a/tests/conftest.py +++ b/tests/conftest.py @@ -23,6 +23,8 @@ @pytest.fixture def scm(fixture_project: Path) -> None: subprocess.check_call(["git", "init"]) + subprocess.check_call(["git", "config", "--local", "user.name", "example"]) + subprocess.check_call(["git", "config", "--local", "user.email", "example@example.com"]) subprocess.check_call(["git", "add", "."]) subprocess.check_call(["git", "commit", "-m", "initial commit"]) subprocess.check_call(["git", "tag", "-a", "0.1.0", "-m", "version 0.1.0"]) --- a/tests/pdm/backend/hooks/version/test_scm.py +++ b/tests/pdm/backend/hooks/version/test_scm.py @@ -126,6 +126,8 @@ def __init__(self, cmd: Path, cwd: Path) -> None: super().__init__(cmd, cwd) self.run("config", "commit.gpgsign", "false") + self.run("config", "--local", "user.name", "example") + self.run("config", "--local", "user.email", "example@example.com") def _init(self): self.run("init")