open-swe/tests/conftest.py
Johannes du Plessis 7877a9003e
fix: separate review access from automatic reviews (#1720)
Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
(cherry picked from commit 92d631704e9c38f6aeedf70baede85a7c638567e)
2026-07-16 17:27:00 -04:00

24 lines
792 B
Python

"""Shared pytest fixtures."""
from __future__ import annotations
import pytest
from agent import webapp
@pytest.fixture(autouse=True)
def _default_enable_auto_review(monkeypatch: pytest.MonkeyPatch) -> None:
"""Treat automatic reviews as enabled for every repo by default.
The dashboard's opt-in list (loaded by :func:`agent.dashboard.enabled_repos.is_review_repo_enabled`)
is empty in the test environment because there is no live LangGraph Store.
Tests targeting the automatic-review gate should override this fixture or set
``monkeypatch.setattr(webapp, "is_review_repo_enabled", ...)`` to a stricter stub.
"""
async def _enabled(_owner: str, _name: str) -> bool:
return True
monkeypatch.setattr(webapp, "is_review_repo_enabled", _enabled)