我无法将allure插件连接到pycharm,因此它可以在./report/目录中自动生成报告。
我无法理解https://github.com/allure-framework/allure-python上面的文档,它有一行说连接到IDE:
pytest_plugins ='allure.pytest_plugin'但是我无法理解我需要在pycharm中进行哪些更改。
您需要创建文件py.test
配置文件conftest.py
。并把你提到的字符串放在那里。不要忘记文件顶部的import pytest
。
转到run>Edit Configurations>Python Tests
并在Additional Arguments
中添加以下行:
--alluredir=./reports/<report-name>
Pytest需要alluredir参数来创建诱惑报告。创建倾城报告后,您可以通过终端中的此命令提供服务:allure serve reports/<report-name>