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>
This commit is contained in:
1 parent
ecf4ec4e8a
commit
4bcb1d6596
3 files changed
+36
-16
No files matched your search
@@ -0,0 +1,17 @@
|
||||
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"
|
||||
Reference in new issue
Block a user