2023-08-14 11:37:20 +00:00
|
|
|
import os
|
2023-09-27 14:33:22 +00:00
|
|
|
from pathlib import Path
|
2023-08-14 11:37:20 +00:00
|
|
|
|
2023-08-16 09:10:06 +00:00
|
|
|
import pytest
|
|
|
|
|
2023-08-14 11:37:20 +00:00
|
|
|
|
|
|
|
@pytest.fixture(autouse=True)
|
2023-08-16 09:10:06 +00:00
|
|
|
def mock_openai_api_key() -> None:
|
|
|
|
"""Set a fake OpenAI API key."""
|
2023-08-14 11:37:20 +00:00
|
|
|
os.environ["OPENAI_API_KEY"] = "dummy_key"
|
2023-09-27 14:33:22 +00:00
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture(autouse=True)
|
2024-06-27 16:05:24 +00:00
|
|
|
def mock_base_dir(tmp_path: Path) -> None:
|
2023-09-27 14:33:22 +00:00
|
|
|
"""Set a fake history directory."""
|
2024-06-27 16:05:24 +00:00
|
|
|
os.environ["OPENAI_BASE_DIR"] = str(tmp_path / ".llm_chat")
|