allure-framework / allure-framework/allure-python

AssertionError vs Exception

Offen
#377 0 Kommentare 8 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

Currently Allure fails only on AssertionError and all Exception is treated as Broken.
This is a good feature but pytest reports them as Fail. This causes a bit of confusion on the report status.

An intermediate approach can be to allow for option on what constitutes a fail.
A suggestion is to provide an API where one can register baseclasses that can be as failures. This provides for better control to use with infrastructures that can have some common analysis to look for additional failures.

```
def get_status(exception):
if exception:
if isinstance(exception, AssertionError) or isinstance(exception, pytest.fail.Exception):
return Status.FAILED
elif isinstance(exception, pytest.skip.Exception):
return Status.SKIPPED
return Status.BROKEN
else:
return Status.PASSED
```

=> Something like...

```
def get_status(exception):
if exception:
for base_class in allure.FailExceptionList:
if isinstance(exception, base_class):
return Status.FAILED
elif isinstance(exception, pytest.skip.Exception):
return Status.SKIPPED
return Status.BROKEN
else:
return Status.PASSED
```

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Das Issue nennt keine Implementierungsdateien oder Tests. Beginne damit, den bestehenden Pfad von Exceptions zu Status zu lokalisieren, der durch get_status und seine pytest-Integration repräsentiert wird; abgeschlossen ist die Aufgabe, wenn konfigurierbare Exception-Basisklassen ermöglicht werden und die Behandlung der Status failed, skipped, broken und passed erhalten bleibt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
testing-qa
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
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.