要解决"allure pytest: 报告中没有测试套件层次结构"的问题,可以尝试以下解决方法:
def test_my_test_case():
# 测试用例的代码
pass
pip install allure-pytest
[pytest]
addopts = --alluredir=report
这将告诉pytest将测试结果输出到"report"目录中。
pytest --alluredir=report
这将在当前目录下生成一个名为"report"的目录,其中包含测试结果的数据。
allure serve report
这将启动一个本地服务器,并打开浏览器显示allure报告。
通过检查测试用例的命名规则,正确安装插件,配置pytest文件,并生成和查看allure报告,应该能够解决"allure pytest: 报告中没有测试套件层次结构"的问题。