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后面的值不能为负值。

应改为:正数

猜你喜欢

转载自www.cnblogs.com/xyao1/p/10932121.html