[pytest]
# Pytest configuration file

# Test discovery patterns
python_files = test_*.py *_test.py
python_classes = Test*
python_functions = test_*

# Test paths
testpaths = tests

# Output options
addopts =
    -v
    --strict-markers
    --tb=short
    --cov=jiuwenswarm
    --cov-report=term-missing
    --cov-report=html
    --cov-report=xml
    --asyncio-mode=auto

# Markers
markers =
    unit: Unit tests
    integration: Integration tests
    system: System tests
    slow: Slow running tests
    async: Async tests

# Logging
log_cli = true
log_cli_level = INFO
log_cli_format = %(asctime)s [%(levelname)s] %(message)s
log_cli_date_format = %Y-%m-%d %H:%M:%S

# Warnings
filterwarnings =
    error
    ignore::DeprecationWarning
    ignore::PendingDeprecationWarning
    ignore::ResourceWarning
    ignore::pytest.PytestUnraisableExceptionWarning
    # pysbd 0.3.4(2020 年后无新版)的 segmenter.py:66 含无效转义 '\s',
    # Python 3.12+ 编译期为 SyntaxWarning——fresh venv 首次导入即触发,
    # 被上方 error 升级为收集错误(本地 venv 靠陈旧 pyc 缓存掩盖)。
    # 定向放行该包;其余 SyntaxWarning 仍按错误拦截(3.14 起将成硬错误)。
    ignore:invalid escape sequence:SyntaxWarning