pytest-mian函数运行

1、设置多并发运行

1、命令行安装

pip install pytest-xdist  #安装插件,进行多并发运行,
#调用:-n -5

 

import pytest


#
pytest.main(["-n","-3",
             #,"--reruns","2","--reruns-delay","3",
              "--html=test_result/report/report.html", "--junitxml=test_result/report/report.xml"
             #,"--alluredir=test_result/allureReports"
            ])

执行结果:ERROR: MISSING test execution (tx) nodes: please specify --tx

出错原因:-n后面的值不能为负值。

应改为:正数

posted @ 2019-05-27 17:54  彼岸大师  阅读(535)  评论(0编辑  收藏  举报