allure-framework / allure-framework/allure-python

Force cast features label values to string

未关闭
#616 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
theme:core type:enhancement
主要语言
Python
星标
814
派生
260
PR 合并指标
30 天内没有已合并 PR

描述

[//]: # (
. Note: for support questions, please use Stackoverflow or Gitter**.
. This repository's issues are reserved for feature requests and bug reports.
.
. In case of any problems with Allure Jenkins plugin** please use the following repository
. to create an issue: https://github.com/jenkinsci/allure-plugin/issues
.
. Make sure you have a clear name for your issue. The name should start with a capital
. letter and no dot is required in the end of the sentence. An example of good issue names:
.
. - The report is broken in IE11
. - Add an ability to disable default plugins
. - Support emoji in test descriptions
)

#### I'm submitting a ...
- feature request

#### What is the current behavior?
https://github.com/allure-framework/allure-python/blob/50cb0ec0f388928eabf1fc5af92a009851d34965/allure-python-commons/src/_allure.py#L45-L46

Features values set as is.

#### What is the expected behavior?

Cast `features` to string

#### What is the motivation / use case for changing the behavior?

For easily cast to feature name from dataclasses

Its look better
```python
@allure.feature(Features.some_feature1, Features.some_feature2)
```
vs
```python
@allure.feature(str(Features.some_feature1), str(Features.some_feature2))
```

#### Please tell us about your environment:

- Allure version: 2.1.0
- Test framework: pytest@6.2.4
- Allure adaptor: allure-pytest@2.9.43

#### Other information

[//]: # (
. e.g. detailed explanation, stacktraces, related issues, suggestions
. how to fix, links for us to have more context, eg. Stackoverflow, Gitter etc
)

贡献指南

打开贡献指南

调研方向

从 allure-python-commons/src/_allure.py 第 45-46 行附近开始,那里目前会按提供的形式保留 feature values。跟踪 feature decorator 的入口点及其现有测试,然后确保将 feature values 转换为字符串,以便可以直接传入 dataclass members;当最终得到的 feature names 是字符串值时即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
python
领域
testing-qa
Issue 类型
功能
难度
2/5
预计耗时
1-3 小时
活跃度
停滞
描述清晰度
描述清楚
新手友好度
55/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。