Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions tests/test_runners.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import pytest

from loopzero import sandbox, worktree
from loopzero import runners, sandbox, worktree
from loopzero.runners import (
REVIEW_SCHEMA,
RunnerAuthFailed,
Expand Down Expand Up @@ -113,8 +113,17 @@ def _bwrap_argv(log: Path) -> list[str]:


@pytest.fixture(autouse=True)
def fake_bwrap(fake_tool, tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> Path:
for name in ("ANTHROPIC_API_KEY", "CLAUDE_CODE_OAUTH_TOKEN", "OPENAI_API_KEY"):
def fake_bwrap(fake_tool, tmp_path: Path, tmp_path_factory, monkeypatch: pytest.MonkeyPatch) -> Path:
# Keep reviewer state outside tmp_path, which many tests mount as the checkout.
home = tmp_path_factory.mktemp("reviewer-home")
monkeypatch.setenv("HOME", str(home))
for name in (
"CODEX_HOME",
"CLAUDE_CONFIG_DIR",
"CLAUDE_SECURESTORAGE_CONFIG_DIR",
*runners.CLAUDE_AUTH_ENV,
*runners.CODEX_AUTH_ENV,
):
monkeypatch.delenv(name, raising=False)
log = tmp_path / "review-bwrap.argv"
fake_tool("bwrap", FAKE_BWRAP.format(log=log))
Expand Down
Loading