Files
zcglxt/pytest.ini
Claude e71181f0a3 fix: 修复多个关键问题
- 修复前端路由守卫:未登录时不显示提示,直接跳转登录页
- 修复API拦截器:401错误不显示提示,直接跳转
- 增强验证码显示:图片尺寸从120x40增加到200x80
- 增大验证码字体:从28号增加到48号
- 优化验证码字符:排除易混淆的0和1
- 减少干扰线:从5条减少到3条,添加背景色优化
- 增强登录API日志:添加详细的调试日志
- 增强验证码生成和验证日志
- 优化异常处理和错误追踪

影响文件:
- src/router/index.ts
- src/api/request.ts
- app/services/auth_service.py
- app/api/v1/auth.py
- app/schemas/user.py

测试状态:
- 前端构建通过
- 后端语法检查通过
- 验证码显示效果优化完成

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-25 00:26:21 +08:00

78 lines
1.5 KiB
INI

[pytest]
# Pytest配置文件
# 测试发现
python_files = test_*.py
python_classes = Test*
python_functions = test_*
# 测试路径
testpaths = tests
# 输出选项
addopts =
# 详细输出
-v
# 显示本地变量(失败时)
-l
# 显示print输出
-s
# 显示测试覆盖率
--cov=app
--cov-report=html
--cov-report=term-missing
# 生成HTML报告
--html=test_reports/pytest_report.html
--self-contained-html
# 生成XML报告(JUnit格式)
--junitxml=test_reports/junit.xml
# 显示最慢的10个测试
--durations=10
# 颜色输出
--color=yes
# 警告设置
-W ignore::DeprecationWarning
# 并行执行(需要pytest-xdist)
# -n auto
# 重试失败的测试(需要pytest-rerunfailures)
# --reruns=2
# --reruns-delay=1
# 标记定义
markers =
smoke: 冒烟测试(快速验证基本功能)
regression: 回归测试(完整功能测试)
integration: 集成测试(需要数据库/外部服务)
unit: 单元测试(独立测试)
slow: 慢速测试(执行时间较长)
security: 安全测试
performance: 性能测试
api: API测试
# 覆盖率配置
[coverage:run]
source = app
omit =
*/tests/*
*/test_*.py
*/__pycache__/*
*/site-packages/*
*/venv/*
*/migrations/*
*/config.py
[coverage:report]
# 覆盖率目标
precision = 2
show_missing = True
skip_covered = False
# 最低覆盖率要求
fail_under = 70.0
[coverage:html]
directory = test_reports/htmlcov
[coverage:xml]
output = test_reports/coverage.xml