[pytest] # 测试目录 testpaths = tests # Python 文件匹配 python_files = test_*.py python_classes = Test* python_functions = test_* # 默认参数 addopts = -v --tb=short --strict-markers # 标记定义 markers = slow: 标记为慢速测试 mock: 需要 Mock 服务的测试 integration: 集成测试(需要完整环境) smoke: 冒烟测试 # 日志配置 log_cli = true log_cli_level = INFO log_cli_format = %(asctime)s [%(levelname)s] %(message)s log_cli_date_format = %H:%M:%S # 超时设置(需要 pytest-timeout 插件) # timeout = 60