allure-framework / allure-framework/allure-python

bug: When the check is placed in the parent step and the child step asserts, the check becomes invalid.

Offen
#824 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Python
Sterne
814
Forks
260
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

[//]: # (
. Note: for support questions, please use Stackoverflow or Gitter**.
. This repository's issues are reserved for feature requests and bug reports.
.
. In case of any problems with Allure Jenkins plugin** please use the following repository
. to create an issue: https://github.com/jenkinsci/allure-plugin/issues
.
. Make sure you have a clear name for your issue. The name should start with a capital
. letter and no dot is required in the end of the sentence. An example of good issue names:
.
. - The report is broken in IE11
. - Add an ability to disable default plugins
. - Support emoji in test descriptions
)

#### I'm submitting a ...
- [x] bug report
- [x] feature request
- [ ] support request => Please do not submit support request here, see note at the top of this template.

#### What is the current behavior?

```python
def validate_something(a, b, c, d):
with check, allure.step(f'some assertions'):
with allure.step('aa'):
assert a == 1
with allure.step('b'):
assert b == 2
with allure.step('cccc'):
assert c == 13
with allure.step('dddd'):
assert d == 4

def test_22():
with check, allure.step("setup step"):
assert 5 == 5
validate_something(1,2,3,4)
```
As above, the test report is:

![image](https://github.com/user-attachments/assets/afd66464-b100-4134-aee1-f3b9e15fab35)

the step dddd won't be executed, the effect of pytest-check is gone

#### If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem
copy the code above

PS:
if run, the step [some assertions] won't be marked as failed, but pass, and the four sub-steps will be executed, I hope if any sub step is failed, the parent should be failed:
```python
def validate_something(a, b, c, d):
with allure.step(f'some assertions'):
with check, allure.step('aa'):
assert a == 1
with check, allure.step('b'):
assert b == 2
with check, allure.step('cccc'):
assert c == 13
with check, allure.step('dddd'):
assert d == 4

def test_22():
with check, allure.step("setup step"):
assert 5 == 5
validate_something(1,2,3,4)
```

main.py run pytest (allure) and get the allure report

#### What is the expected behavior?
step dddd should be executed

#### What is the motivation / use case for changing the behavior?

#### Please tell us about your environment:

- Allure version: 2.13.5
- Test framework: pytest@8.2.2
- pytest-check: 2.3.1
- Allure adaptor: allure-pytest@2.13.5

#### Other information

[//]: # (
. e.g. detailed explanation, stacktraces, related issues, suggestions
. how to fix, links for us to have more context, eg. Stackoverflow, Gitter etc
)

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginnen Sie mit der Python-Reproduktion im Issue, verwenden Sie main.py und führen Sie pytest mit den aufgeführten Allure- und pytest-check-Versionen aus. Verfolgen Sie, wie der äußere Check-Kontext mit den verschachtelten allure.step-Blöcken interagiert. Als erledigt gilt die Aufgabe, wenn der Schritt dddd nach einem früheren Assertion-Fehler ausgeführt wird und der übergeordnete Schritt some assertions als fehlgeschlagen markiert wird, wenn eine untergeordnete Assertion fehlschlägt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

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

Neue Issues direkt in Ihr Postfach

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