Files
agentci/tests/conftest.py
T
StanPonomarev ce9f1e3d20
Publish container image / Build and push (push) Successful in 32s
refactor tests
2026-07-26 23:49:40 +02:00

27 lines
609 B
Python

from dataclasses import dataclass
from pathlib import Path
import pytest
from agentci.engine import _sqlite
from agentci.engine.repository import Repository
@pytest.fixture
async def engine_repository(tmp_path: Path) -> Repository:
repository = Repository(tmp_path / "state.sqlite3")
await repository.initialize()
return repository
@dataclass
class SQLiteClock:
now: str = "2026-02-01T00:00:00+00:00"
@pytest.fixture
def sqlite_clock(monkeypatch: pytest.MonkeyPatch) -> SQLiteClock:
clock = SQLiteClock()
monkeypatch.setattr(_sqlite, "now", lambda: clock.now)
return clock