"""共享 fixture。""" from __future__ import annotations from pathlib import Path import pytest from cybergril.config import CharacterConfig, ModelsConfig, Settings from cybergril.memory import Store @pytest.fixture def repo_root() -> Path: return Path(__file__).resolve().parents[1] @pytest.fixture def settings(repo_root: Path) -> Settings: return Settings( models=ModelsConfig(), character=CharacterConfig(identity={"y": 2000, "m": 1, "d": 1, "h": 12}), db_path=repo_root / "test.db", ) @pytest.fixture def store(tmp_path: Path) -> Store: s = Store(tmp_path / "test.db") yield s s.close()