allure-framework / allure-framework/allure-python

Support python subtests and show failures of subtests in the report

未关闭
#374 2 条评论 7 个 reaction 已指派 0 人 在 GitHub 查看
task:new feature theme:pytest
主要语言
Python
星标
814
派生
260
PR 合并指标
30 天内没有已合并 PR

描述

#### I'm submitting a ...
- [x] feature request

#### What is the current behavior?
I'm using soft asserts in my tests. I've implemented those using the subTest python lib.
Example:
```
def __soft_assert_equal(self, a, b, msg):
with self.subTest():
self.assertEqual(a, b, msg)
```
This way if a soft assert fails the tests scripts will go on and execute the next asserts.
I'm running the tests with pytest and using this plugin to show the soft assert failures in the pytest output https://github.com/pytest-dev/pytest-subtests.

However the Allure reports do not show the failures from the subTest and show the test as passed.
Could this be implemented, so Allure reports will show if a assert from a subTest has failed and fail the test in that case? Thanks

#### Please tell us about your environment:

- Allure version: 2.11.0
- Test framework: Python 3.7.3, pytest-4.4.1
- Allure adaptor: allure-pytest-2.6.2

贡献指南

打开贡献指南

调研方向

使用 Python subTest、pytest、pytest-subtests 和 allure-pytest 2.6.2 重现该示例,然后检查生成的 Allure 报告。当报告中出现失败的 subTest,并导致整个测试失败,同时后续的 soft assertions 仍继续运行时,工作即完成。

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

评估

技术栈
python
领域
testing
Issue 类型
功能
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

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