import pytest from chemenu.evals.baseline import GIT_REPO_ENV @pytest.fixture(autouse=True) def _isolated_git(monkeypatch: pytest.MonkeyPatch) -> None: """Keep git in tests away from the repository running them. `git rebase --exec` and hooks export GIT_DIR; without this, `git init` and `git commit` in a test would act on the checkout itself. """ for name in GIT_REPO_ENV: monkeypatch.delenv(name, raising=False) monkeypatch.setenv("GIT_CONFIG_GLOBAL", "/dev/null") monkeypatch.setenv("GIT_CONFIG_NOSYSTEM", "1")