pytest基本使用

一、pytest 安装

官方文档:https://docs.pytest.org/en/latest/

1. pytest安装
	pip install pytest -U -i https://pypi.tuna.tsinghua.edu.cn/simple
	
# 常用插件
1. html 报告插件
	pip install pytest-html
	使用方法:pytest --html=report.html
2. 分布式运行
	pip install pytest-xdist
	使用方法:
		pytest  -n  2   (2代表2个CPU)
		pytest  -n  auto
3.失败重跑插件
	pip install pytest-rerunfailures
	使用方法:
		1. 指定单个用例:@pytest.mark.flaky(reruns = 5 ,reruns-delay = 1 )
		2. 命令行运行:pytest test_demo.py --reruns 5 --reruns-delay 1 -vs
4.allure报告
	pip install allure-pytes
    注意:allure win上需要单独下载安装
5.执行顺序插件
	pip install  pytest-ordering
	使用方法  :  @pytest.mark.run(order=2)
6.多重校验
	pip install  pytest-
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值