import os from pathlib import Path import pytest @pytest.fixture(autouse=True) def mock_openai_api_key() -> None: """Set a fake OpenAI API key.""" os.environ["OPENAI_API_KEY"] = "dummy_key" @pytest.fixture(autouse=True) def mock_history_dir(tmp_path: Path) -> None: """Set a fake history directory.""" os.environ["OPENAI_HISTORY_DIR"] = str(tmp_path / ".llm_chat")