pytest.ini 配置教程
[pytest]
;addopts:配置命令行参数,用空格进行分隔
;可执行标记为mark的对应用例,用or表示标记为demo或者smoke的用例都会执行
addopts = -vs --alluredir=./results/json --clean-alluredir -m "demo or smoke"
;注册 mark 标记
markers =
demo : marks tests as demo
smoke: marks tests as smoke
uat : marks tests as uat
test : marks tests as test
minversion = 5.0
;测试用例的路径,可自己配置,
;../pytestproject为上一层的pytestproject文件夹
;./testcase为pytest.ini当前目录下的同级文件夹
;改变用例的查找路径规则,当前目录的testcase文件夹
testpaths =./testcase
;模块名的规则,配置测试搜索的模块文件名称
python_files = test*.py
;类名的规则,配置测试搜索的测试类名
python_classes = Test*
;方法名的规则,配置测试搜索的测试函数名
python_functions = test
参考教程 https://blog.csdn.net/Moonlight_16/article/details/122706934

浙公网安备 33010602011771号