1、pytest安装
pytest是web自动化的一种框架,对测试用例进行管理、执行、记录、出具报告的。pytest是一种外置框架,要想使用必须先安装
2、pytest与unittest的区别
unittest:
1、内置库,不用安装,直接调用
2、使用范围:可在java与python中使用
3、使用过程比较复杂,必须有以下4步:testcase,testsuite,testloader,testrunner
4、可以使用的插件少
pytest:
1、外置库,需要安装才能使用
2、适用范围:python
3、使用过程简单:编写测试用例--执行
4、可用插件多
3、pytest的常用插件
pytest:框架本体
pytest-html 生成HTML的测试报告
pytest-xdist 并行执行测试用例
pytest-rerunfailures 失败重跑
pytest-ordering 测试用例的顺序
allure-pytest 生成allure报告
想要使用以上插件都需要先安装,安装方法同pytes