-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconftest.py
More file actions
29 lines (20 loc) · 963 Bytes
/
Copy pathconftest.py
File metadata and controls
29 lines (20 loc) · 963 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
"""Project-wide pytest configuration.
Two things this file handles before any test runs:
* Force the offline / deterministic code paths for the RAG services so tests do
not download models, stream datasets, or call external APIs. Backend modules
call ``load_project_env()`` at import time which reads ``.env`` only for keys
that are NOT already set, so these assignments must happen before any
``backend.*`` module is imported.
* Pin pytest's ``basetemp`` to a workspace-local folder. The default Windows
temp directory is locked on some workstations, which makes ``tmp_path`` raise
``PermissionError`` during fixture setup.
"""
import os
from pathlib import Path
os.environ["RAG_USE_REAL_MODELS"] = "0"
os.environ["RAG_USE_REAL_DATASET"] = "0"
os.environ["TAVILY_API_KEY"] = ""
ROOT = Path(__file__).resolve().parent
def pytest_configure(config):
if not config.option.basetemp:
config.option.basetemp = str(ROOT / ".pytest_tmp")