前言
- 前面几篇文章主要介绍了allure的特性,这篇文章我们就来讲下allure的标记用法
- 有时候我们写pytest的时候,会用到 @pytest.mark 但并不会显示在allure报告上
- 而allure也提供了三种类型的标记装饰器,它们是可以显示在allure报告上的
allure的标记装饰器
- BDD样式的标记装饰器
- 优先级(严重程度)标记装饰器
- 自定义标记装饰器
BDD标记装饰器
提供了三个装饰器
- @allure.epic:敏捷里面的概念,定义史诗,往下是 feature
- @allure.feature:功能点的描述,理解成模块往下是 story
- @allure.story:故事,往下是 title
- 栗子一(story+feature)测试代码
-
栗子一(story+feature) 测试代码 #!/usr/bin/env python # -*- coding: utf-8 -*- """ __title__ = __Time__ = 2022/2/23 """ import allure def test_without_any_annotations_that_wont_be_executed(): pass @allure.story('e