[pytest]
# Test the checkout rather than an installed package.
# st_test 下是黑盒 ST(独立契约 + workswarm 兼容),不随 tests 默认收集。
pythonpath = . st_test

# 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=agent_gateway
    --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
    # uvicorn>=0.54 在导入 websockets 实现时告警,与 gateway 行为无关。
    # 用 module 过滤而非 UvicornDeprecationWarning 类:旧版 uvicorn 没有该类,
    # 直接引用会让 pytest 在解析配置时 AttributeError(与 workswarm 共环境时会踩到);
    # module 必须写实际抛出告警的模块(websockets_impl),config 模块只定义异常类。
    ignore::UserWarning:uvicorn.protocols.websockets.websockets_impl
    ignore::PendingDeprecationWarning
    ignore::ResourceWarning
    ignore::pytest.PytestUnraisableExceptionWarning