allure-framework / allure-framework/allure-python

Support python subtests and show failures of subtests in the report

Ouverte
#374 2 commentaires 7 réactions 0 personnes assignées Voir sur GitHub
task:new feature theme:pytest
Langage dominant
Python
Étoiles
814
Forks
260
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

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

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Reproduisez l’exemple avec Python subTest, pytest, pytest-subtests et allure-pytest 2.6.2, puis inspectez le rapport Allure généré. Le travail est terminé lorsqu’un subTest en échec apparaît dans le rapport et entraîne l’échec du test global, tandis que les soft assertions suivantes continuent de s’exécuter.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
python
Domaine
testing
Type d'issue
Fonctionnalité
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.