问题描述
在pycharm上可以正常生成报告,但是在jenkins上运行时一直报以下错误。
pytest: error: unrecognized arguments: --alluredir=reports
inifile: None
rootdir: D:\xxx
原因分析:
搜集了大量资料,总结一下:
1、安装allure-pytest与allure-python-commons的环境是虚拟环境,不是pytest运行的环境;
2、有多个python,导致出错。
解决方案:
针对1解决方案:
1、cmd 输入pip list查看安装情况,没有allure-pytest 执行pip install allure-pytest应该就可以了;
2、已经有安装的,需要重新安装allure-pytest与allure-python-commons,最好两个都卸载,不然有可能出问题,卸载命令pip uninstall allure-pytest、pip uninstall allure-python-commons,安装命令pip install allure-pytest、pip install allure-python-commons
博客讲述了在PyCharm上能正常生成Allure报告,但在Jenkins环境中遇到'unrecognized arguments: --alluredir=reports'错误的问题。原因可能是Allure相关库未在正确的环境中安装或者存在多个Python环境。解决方案包括检查并确保allure-pytest与allure-python-commons在pytest运行的环境中正确安装和更新。
820

被折叠的 条评论
为什么被折叠?



