Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
2 of 3 tasks
Faerie1999 opened this issue Jul 15, 2024 · 0 comments

Comments

@Faerie1999
Copy link

Faerie1999 commented Jul 15, 2024

I'm submitting a ...

  • bug report
  • feature request
  • support request => Please do not submit support request here, see note at the top of this template.

What is the current behavior?

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

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:

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

Tasks

No tasks being tracked yet.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant