-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpytest.ini
More file actions
118 lines (108 loc) · 2.27 KB
/
pytest.ini
File metadata and controls
118 lines (108 loc) · 2.27 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
[pytest]
# 基本配置
minversion = 7.0
testpaths = tests
python_files = test_*.py
python_classes = Test*
python_functions = test_*
# 超时配置 - 防止测试无限挂起
timeout = 300
timeout_method = thread
# 标记配置
markers =
slow: 慢速测试(超过5秒的测试)
unit: 单元测试
integration: 集成测试
ui: UI相关测试
network: 需要网络的测试
db: 数据库相关测试
external: 需要外部依赖的测试
concurrent: 并发测试
flaky: 可能不稳定的测试
smoke: 冒烟测试
critical: 关键路径测试
skip_ci: CI环境跳过的测试
# 输出配置
addopts =
-ra
--strict-markers
--strict-config
--showlocals
--tb=short
--cov=plookingII
--cov-report=term-missing:skip-covered
--cov-report=html:htmlcov
--cov-report=xml:coverage.xml
--cov-branch
--cov-fail-under=45
--maxfail=10
--durations=10
-p no:warnings
--timeout=300
--timeout_method=thread
# 并发配置 - 防止死锁
# 使用 -n auto 时自动检测CPU核心数
# filterwarnings =
# error
# ignore::UserWarning
# ignore::DeprecationWarning
# 日志配置
log_cli = true
log_cli_level = INFO
log_cli_format = %(asctime)s [%(levelname)8s] %(message)s
log_cli_date_format = %Y-%m-%d %H:%M:%S
log_file = tests.log
log_file_level = DEBUG
log_file_format = %(asctime)s [%(levelname)8s] [%(filename)s:%(lineno)d] %(message)s
log_file_date_format = %Y-%m-%d %H:%M:%S
# 测试发现配置
norecursedirs =
.git
.tox
dist
build
*.egg
__pycache__
.pytest_cache
htmlcov
.coverage
original
archive
release
# 覆盖率配置
[coverage:run]
branch = True
source = plookingII
omit =
*/tests/*
*/test_*.py
*/__pycache__/*
*/site-packages/*
*/distutils/*
*/build/*
*/dist/*
*/original/*
*/archive/*
*/.tox/*
*/venv/*
*/logo/*
plookingII/__main__.py
[coverage:report]
precision = 2
show_missing = True
skip_covered = False
skip_empty = True
sort = Cover
exclude_lines =
pragma: no cover
def __repr__
def __str__
raise AssertionError
raise NotImplementedError
if __name__ == .__main__.:
if TYPE_CHECKING:
@abstractmethod
@abstract
pass
[coverage:html]
directory = htmlcov