Files
chemenu-ng/tests/test_git_isolation.py
torbenandClaude Sonnet 5.5 4bcb1d6596 Isolate git environment for all tests
Move the _isolated_git fixture to tests/conftest.py so git rebase --exec
cannot leak GIT_DIR into any test; add a test outside tests/evals.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-12-05 07:15:13 +01:00

18 lines
390 B
Python

import os
def test_git_repo_env_is_removed() -> None:
leaked = [
n
for n in os.environ
if n.startswith("GIT_")
and n
not in {
"GIT_CONFIG_GLOBAL",
"GIT_CONFIG_NOSYSTEM",
}
]
assert leaked == []
assert os.environ["GIT_CONFIG_GLOBAL"] == "/dev/null"
assert os.environ["GIT_CONFIG_NOSYSTEM"] == "1"