allure-framework / allure-framework/allure-python

Support python subtests and show failures of subtests in the report

Abierto
#374 2 comentarios 7 reacciones 0 asignados Ver en GitHub
task:new feature theme:pytest
Lenguaje dominante
Python
Estrellas
814
Forks
260
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

#### 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

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Reproduce el ejemplo usando Python subTest, pytest, pytest-subtests y allure-pytest 2.6.2; después, inspecciona el informe de Allure generado. El trabajo estará terminado cuando aparezca un subTest fallido en el informe y haga que falle la prueba general, mientras las soft assertions posteriores siguen ejecutándose.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
python
Área
testing
Tipo de issue
Nueva funcionalidad
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.