问答 pytest.main 通过 PyInstaller 打包后,exe 程序执行异常重启

uma · 2023年10月26日 · 2980 次阅读

pytest.main 通过 PyInstaller 打包后,如果 pytest.main 带了 '--workers=1', '--tests-per-worker=20' 这两个参数 ,exe 程序执行到 pytest.main 代码就会异常重启。
如果不打包是可以正常执行。
如果不带这两个参数打包也能正常运行,就是用例多,效率低。
目前多线程插件用的是 pytest-parallel。
收集报告用的是 allure
报错那行代码是:pytest.main(['-s', suitFileDict[suitType], '--alluredir', xml_dirPath, '--workers=1', '--tests-per-worker=20'])
打包脚本是:

暫無回覆。
需要 登录 後方可回應,如果你還沒有帳號按這裡 注册