forked from hanwenlu2016/web-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpytest.ini
58 lines (43 loc) · 2.12 KB
/
pytest.ini
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
[pytest]
;指定运行测试所需的最小pytest版本
minversion = 6.0
;命令参数
addopts = -vs
;addopts = -vs -p no:warnings 完全禁用警告
;必须存在这些插件才能运行,插件可以直接在其名称后面带有或不带有版本
#required_plugins = pytest-xdist>=2.0,<2.2 pytest-ordering>=0.6
required_plugins = pytest-xdist pytest-ordering
;执行用例路径目录 多个时空格隔开
testpaths = case
;只执行test*的py文件,多个时空格隔开或者多行
python_files = test*.py
;只执行Test*开始的类
python_classes = Test*
;只执行test*开始的函数
python_funtions = test*
;过滤告警信息
filterwarnings =
ignore::UserWarning
ignore::DeprecationWarning
;标记记录 多行记录
markers = test_api
test_open_wechat_addroid
testbaidu_web
testbaidu_web1
testwy_web
;addopts 参数说明
; -s:输出调试信息,包括print打印的信息。
; -v:显示更详细的信息。
; -q:显示简略的结果 与-v相反
; -p no:warnings 过滤警告
; -n=num:启用多线程或分布式运行测试用例。需要安装 pytest-xdist 插件模块。
; -k=value:用例的nodeid包含value值则用例被执行。
; -m=标签名:执行被 @pytest.mark.标签名 标记的用例。
; -x:只要有一个用例执行失败就停止当前线程的测试执行。
; --maxfail=num:与-x功能一样,只是用例失败次数可自定义。
; --reruns=num:失败用例重跑num次。需要安装 pytest-rerunfailures 插件模块。
; -l: 展示运行过程中的全局变量和局部变量
; --collect-only: 罗列出所有当前目录下所有的测试模块,测试类及测试函数
; --ff: 如果上次测试用例出现失败的用例,当使用--ff后,失败的测试用例会首先执行,剩余的用例也会再次执行一次 *基于生成了.pytest_cache文件
; --lf: 当一个或多个用例失败后,定位到最后一个失败的用例重新运行,后续用例会停止运行。*基于生成了.pytest_cache文件
; --html=report.html: 在当前目录生成名为report.html的测试报告 需要安装 pytest-html 插件模块。