From 8eab385af0e3a1012e92e2b8db98931958ade56b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Sat, 21 Oct 2023 16:45:10 +0200 Subject: [PATCH] Fix test errors related to git config Not sure why it does not fail for all variants. --- ...test_oca_git_push_if_remote_did_not_change.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/test_oca_git_push_if_remote_did_not_change.py b/tests/test_oca_git_push_if_remote_did_not_change.py index 687cf02..1566ee8 100644 --- a/tests/test_oca_git_push_if_remote_did_not_change.py +++ b/tests/test_oca_git_push_if_remote_did_not_change.py @@ -8,6 +8,14 @@ def repo_dir(tmp_path_factory) -> str: repo_path = tmp_path_factory.mktemp("repo") subprocess.check_call(["git", "init"], cwd=repo_path) + subprocess.check_call( + ["git", "config", "user.email", "test@example.com"], + cwd=repo_path, + ) + subprocess.check_call( + ["git", "config", "user.name", "test"], + cwd=repo_path, + ) (repo_path / "README").touch() subprocess.check_call(["git", "add", "."], cwd=repo_path) subprocess.check_call(["git", "commit", "-m", "initial commit"], cwd=repo_path) @@ -24,6 +32,14 @@ def git_clone_path(repo_dir: str, tmp_path) -> Path: subprocess.check_call( ["git", "clone", "--depth=1", "file://" + repo_dir, str(clone_path)] ) + subprocess.check_call( + ["git", "config", "user.email", "test@example.com"], + cwd=clone_path, + ) + subprocess.check_call( + ["git", "config", "user.name", "test"], + cwd=clone_path, + ) return clone_path