-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathpytest.ini
More file actions
73 lines (64 loc) · 1.36 KB
/
pytest.ini
File metadata and controls
73 lines (64 loc) · 1.36 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
[tool:pytest]
# pytest 配置文件
# 测试目录
testpaths = tests
# 测试文件模式
python_files = test_*.py *_test.py
# 测试类模式
python_classes = Test*
# 测试函数模式
python_functions = test_*
# 命令行选项
addopts =
# 详细输出
-v
# 显示测试覆盖的本地变量
-l
# 显示每个测试的估计时间
--durations=10
# 并行执行测试(如果安装了 pytest-xdist)
-n auto
# 显示打印输出
-s
# 覆盖率配置
--cov=core
--cov-report=html:htmlcov
--cov-report=term-missing
--cov-report=xml:coverage.xml
# 最小覆盖率要求
--cov-fail-under=70
# 异步测试支持
--asyncio-mode=auto
# 标记定义
markers =
unit: 单元测试
integration: 集成测试
slow: 慢速测试
security: 安全测试
performance: 性能测试
ai: AI相关测试
gui: GUI相关测试
# 覆盖率配置
[coverage:run]
source = core
omit =
*/tests/*
*/test_*.py
*/__pycache__/*
*/site-packages/*
*/venv/*
*/virtualenv/*
*/conftest.py
[coverage:report]
precision = 2
show_missing = True
skip_covered = False
exclude_lines =
# 标准的跳过覆盖的代码
pragma: no cover
def __repr__
raise AssertionError
raise NotImplementedError
if __name__ == .__main__.:
if TYPE_CHECKING:
@abstractmethod