-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathpytest.ini
More file actions
71 lines (60 loc) · 1.46 KB
/
Copy pathpytest.ini
File metadata and controls
71 lines (60 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
[tool:pytest]
# pytest配置文件
# 测试发现
testpaths = tests
python_files = test_*.py
python_classes = Test*
python_functions = test_*
# 标记定义
markers =
unit: 单元测试
integration: 集成测试
data_validation: 数据验证测试
performance: 性能测试
slow: 慢速测试(运行时间较长)
smoke: 冒烟测试(快速验证基本功能)
regression: 回归测试
security: 安全测试
# 输出配置
addopts =
-v
--tb=short
--strict-markers
--disable-warnings
--color=yes
--durations=10
--cov=src
--cov-report=html:tests/reports/coverage
--cov-report=term-missing
--cov-fail-under=70
--junit-xml=tests/reports/junit.xml
# 最小版本要求
minversion = 7.0
# 测试超时
timeout = 300
# 并发配置
# addopts = -n auto # 如果安装了pytest-xdist可以启用并行测试
# 过滤警告
filterwarnings =
ignore::DeprecationWarning
ignore::PendingDeprecationWarning
ignore::FutureWarning
ignore:.*urllib3.*:DeprecationWarning
# 日志配置
log_cli = true
log_cli_level = INFO
log_cli_format = %(asctime)s [%(levelname)8s] %(name)s: %(message)s
log_cli_date_format = %Y-%m-%d %H:%M:%S
# 收集配置
collect_ignore =
setup.py
build
dist
.git
.venv
venv
node_modules
# 缓存配置
cache_dir = .pytest_cache
# 测试会话配置
console_output_style = progress