mirror of
https://github.com/cocoindex-io/cocoindex-code.git
synced 2026-09-14 16:39:38 +08:00
18 lines
428 B
Python
18 lines
428 B
Python
"""Pytest configuration and fixtures."""
|
|
|
|
import os
|
|
import tempfile
|
|
from pathlib import Path
|
|
|
|
import pytest
|
|
|
|
# === Environment setup BEFORE any cocoindex_code imports ===
|
|
_TEST_DIR = Path(tempfile.mkdtemp(prefix="cocoindex_test_"))
|
|
os.environ["COCOINDEX_CODE_ROOT_PATH"] = str(_TEST_DIR)
|
|
|
|
|
|
@pytest.fixture(scope="session")
|
|
def test_codebase_root() -> Path:
|
|
"""Session-scoped test codebase directory."""
|
|
return _TEST_DIR
|