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>
18 lines
390 B
Python
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"
|