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

uma · October 26, 2023 · 3702 hits

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'])
打包脚本是:

No Reply at the moment.
需要 Sign In 后方可回复, 如果你还没有账号请点击这里 Sign Up