pytest 常用内置插件

 

直接pip安装使用即可:

pip install -U pytest  #安装

pip show pytest  #查看版本(也可 pytest --version 查看版本)

 

1、pytest-xdist
功能:开启多个进程,指定cpu同时执行多个测试用例,达到进程并发运行的效果
官网介绍:https://pypi.org/project/pytest-xdist/

2、pytest-allure-adaptor(已过时了,现大多使用allure-pytest插件)
功能:生成allure报告,推荐jenkins构建时使用
官网介绍:https://pypi.org/project/pytest-allure-adaptor/

3、pytest-html  (一般看报告还是结合的是allure)
功能:生成html格式报告,推荐自己本地使用
官网介绍:https://pypi.org/project/pytest-html/

4、pytest-rerunfailures
功能:自动重跑失败用例
官网介绍:https://pypi.org/project/pytest-rerunfailures/3.1/

5、pytest-cache
功能:重跑上次失败的用例
官网介绍:https://pypi.org/project/pytest-cache/

6、pytest-ordering
功能:可自定义用例执行顺序。
官网介绍:https://pypi.org/project/pytest-ordering/

7、pytest-sugar
功能:增加显示一个进度条,并立即显示失败的测试。(为了好看点,其实正常使用pytest运行时也是有进度存在的)
官网介绍:https://pypi.org/project/pytest-sugar/

 

posted on 2020-07-04 13:59  QiKa  阅读(263)  评论(0编辑  收藏  举报