"""
conftest.py

pytest 실행 환경 설정:
- sys.path에 libs, services 디렉토리 추가
- anyio 백엔드 설정
"""

import os
import sys

# libs 디렉토리를 sys.path에 추가 (search.py, embedding_service.py 등)
libs_path = os.path.join(os.path.dirname(__file__), "..", "..", "libs")
libs_path = os.path.abspath(libs_path)
if libs_path not in sys.path:
    sys.path.insert(0, libs_path)

# services 디렉토리를 sys.path에 추가 (mcp_server.py)
services_path = os.path.join(os.path.dirname(__file__), "..")
services_path = os.path.abspath(services_path)
if services_path not in sys.path:
    sys.path.insert(0, services_path)

import pytest


# anyio pytest 마커 사용을 위해 asyncio 백엔드 설정
@pytest.fixture(params=["asyncio"])
def anyio_backend(request):
    return request.param
