ForcePilot/backend/test/conftest.py
Wenjie Zhang 4f6353d555 feat(test): 重组测试目录结构为 integration/unit/e2e 三层架构
- 将 api 测试重组为 integration 测试
- 新增 unit 和 e2e 测试目录分类
- 新增 testing-guidelines.md 测试指南文档
- 更新 pyproject.toml 和 run_tests.sh 以适配新结构

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-30 15:24:47 +08:00

27 lines
975 B
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")
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"]