| import os | |
| from pathlib import Path | |
| import pytest | |
| from dotenv import load_dotenv | |
| from google import genai | |
| load_dotenv(Path(__file__).resolve().with_name(".env")) | |
| pytestmark = pytest.mark.live_api | |
| def test_gemini(): | |
| api_key = os.getenv("GOOGLE_API_KEY") | |
| if not api_key: | |
| pytest.skip("GOOGLE_API_KEY not configured") | |
| client = genai.Client(api_key=api_key) | |
| response = client.models.generate_content( | |
| model="gemini-2.0-flash", | |
| contents=["Hello"], | |
| ) | |
| assert response.text | |