ForcePilot/backend/test/conftest.py
Kris b3bdb4fa2f feat: 新增TTS语音合成、音视频解析能力
1. 新增内置TTS工具,支持OpenAI兼容语音合成服务
2. 新增ASR音频解析和视频解析处理器
3. 扩展文件解析支持范围,添加音视频格式支持
4. 新增ffmpeg音视频处理基础工具库
5. 补充相关单元测试用例
2026-06-13 20:33:40 +08:00

39 lines
1.4 KiB
Python

from __future__ import annotations
import os
import sys
from pathlib import Path
import pytest
PROJECT_ROOT = Path(__file__).resolve().parents[1]
if str(PROJECT_ROOT) not in sys.path:
sys.path.insert(0, str(PROJECT_ROOT))
# Avoid package-level knowledge graph initialization during pytest collection.
os.environ.setdefault("YUXI_SKIP_APP_INIT", "1")
# Pre-populate sys.modules for packages with heavy __init__.py imports
# (sklearn/scipy/numpy chain) so that submodules can be imported directly.
import types
_PACKAGE_DIR = PROJECT_ROOT / "package"
for _mod_name in ("yuxi.knowledge", "yuxi.knowledge.parser"):
if _mod_name not in sys.modules:
_m = types.ModuleType(_mod_name)
_m.__path__ = [str(_PACKAGE_DIR / _mod_name.replace(".", os.sep))]
_m.__package__ = _mod_name
sys.modules[_mod_name] = _m
def pytest_configure(config: pytest.Config) -> None:
"""Register shared markers without binding every test to a live environment."""
config.addinivalue_line("markers", "unit: marks tests that run without live services")
config.addinivalue_line("markers", "auth: marks tests that require authentication")
config.addinivalue_line("markers", "integration: marks tests that hit the live API service")
config.addinivalue_line("markers", "e2e: marks tests that exercise an end-to-end workflow")
config.addinivalue_line("markers", "slow: marks tests as slow")
pytest_plugins = ["pytest_asyncio"]