Skip to main content
 首页 » 编程设计

python之Pytest/Allure之如何生成测试用例描述

2025年04月02日14落叶无声

我对 Allure 还是很陌生,我正在尝试在我的报告中生成测试描述。查看其他 SO 问题和 pytest-allure-adaptor 文档,似乎没有执行此操作的选项。

我最接近的是这样写:

def test_one(): 
   """ 
   This is the test description. 
   """ 
   assert pass 

这是非常有限的,因为它会自动折叠它。在 Allure 示例报告中,您可以看到他们可以使用标题和某种 Markdown 。我如何使用 pytest-allure-adaptor 做到这一点?

请您参考如下方法:

目前您无法更改 PyTest Adaptor 中的描述类型。见issue https://github.com/allure-framework/allure-python/issues/93