Skip to content

Commit 678a883

Browse files
committed
Fix pytest failure by isolating git environment in tests
1 parent a355f06 commit 678a883

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

tests/unit/test_engraphis_history.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ def _git(cwd, *args, env=None):
3535
import os
3636

3737
full = dict(os.environ)
38+
full.pop("GIT_DIR", None)
39+
full.pop("GIT_WORK_TREE", None)
40+
full.pop("GIT_INDEX_FILE", None)
3841
full.update(GIT_ENV)
3942
full.update(env or {})
4043
out = subprocess.run(["git", "-C", str(cwd), *args], capture_output=True,

0 commit comments

Comments
 (0)