"""Real Gemini calls. Opt-in: needs GOOGLE_API_KEY. Run with: pytest -m live -s""" import os import pytest from ai_coach.config import Settings from ai_coach.service import CoachService from .helpers import example_names, load_example pytestmark = [pytest.mark.live, pytest.mark.skipif(not os.environ.get("GOOGLE_API_KEY"), reason="no GOOGLE_API_KEY")] @pytest.mark.parametrize("name", [n for n in example_names() if not n.startswith("real_")]) def test_live_notes_pass_guardrails(name, tmp_path): settings = Settings(cache_path=tmp_path / "c.sqlite3") result = CoachService(settings).coach(load_example(name)) print( name, result.source, result.model, result.attempts, f"${result.usage.cost_usd:.5f}", result.usage.cached_tokens, result.violations, ) assert result.source == "llm", result.violations assert result.usage.cost_usd < 0.01