allure-framework / allure-framework/allure-python

Support python subtests and show failures of subtests in the report

Offen
#374 2 Kommentare 7 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
task:new feature theme:pytest
Vorherrschende Sprache
Python
Sterne
814
Forks
260
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Reproduziere das Beispiel mit Python subTest, pytest, pytest-subtests und allure-pytest 2.6.2 und untersuche anschließend den generierten Allure-Bericht. Die Arbeit ist abgeschlossen, wenn ein fehlgeschlagenes subTest im Bericht erscheint und dazu führt, dass der Gesamttest fehlschlägt, während spätere Soft Assertions weiterhin ausgeführt werden.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
testing
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.