当前位置:   article > 正文

Pytest之用例执行--并发执行、重复执行、输出报告_pytest count和并发

pytest count和并发

前言:pytest 运行用例,如果是本地单个执行,那可以在IDE环境中通过手工点击或者按目录方式执行,但是这种方式都是串行的,实际使用中会有需要并发和重复执行的需求,这里将操作命令梳理下。

依赖安装:

用例并发执行依赖:pip install pytest-xdist

用例重复执行依赖:pip install pytest-repeat

用例基础报告依赖:pip install pytest-html

用例allure报告依赖:pip install allure-pytest  (allure配置手册

命       令:pytest -v -n 4  --html=report.html  test_fund_list_detail_check.py -s --count=3

命令解释:

  1. -v -n 4  表示 开启4个进程来执行用例;
  2. --html=report.html 表示用例执行报告输出到report.html
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/很楠不爱3/article/detail/649463
推荐阅读
相关标签
  

闽ICP备14008679号