小编Lav*_*nya的帖子

使用pytest生成诱惑报告

我正在使用py测试诱惑适配器并尝试生成诱惑报告所需的输入数据.但我无法生成任何XML.当我使用py.test sample.py执行py文件时,它确实创建了pycache目录.然后我执行了"诱惑生成-v 1.3.9 C:\ allurereports"(这是我有sample.py的目录).它确实创建了一个诱人的HTML报告,但没有测试用例是0.没有详细信息.

sample.py(与示例中给出的相同)

import allure


@allure.feature('Feature1')
@allure.story('Story1')
def test_minor():
    assert False


@allure.feature('Feature2')
@allure.story('Story2', 'Story3')
@allure.story('Story4')
class TestBar:

    # will have 'Feature2 and Story2 and Story3 and Story4'
    def test_bar(self):
        pass
Run Code Online (Sandbox Code Playgroud)

这是使用的py.test命令:py.test sample.py --allure_features = feature1,feature2

任何人都可以帮助我如何从文件中生成一个诱惑报告.有哪些命令要执行.

python pytest allure

5
推荐指数
3
解决办法
2万
查看次数

标签 统计

allure ×1

pytest ×1

python ×1