You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@check.check_func
def validate_something(a, b, c, d):
with 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)
or
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
run the code, the step dddd won't executed , just as below:
The text was updated successfully, but these errors were encountered:
I think this is in line with the design expectations.
If your check point are not interdependent. , your code should be follow:
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
I think this is in line with the design expectations. If your check point are not interdependent. , your code should be follow:
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
I have indeed done this before. if run, the step [some assertions] won't be marked as failed, but passed, and the four sub-steps will be executed, I hope if any sub step is failed, the parent should be marked as failed, and all sub-steps should be executed:
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)
I'd consider this a feature request, to support allure.step() in conjunction with check.
I would look at a PR for this, but since I don't use allure, I don't have plans to work on this.
I'd also want any changes to not affect performance negatively.
okken
changed the title
bug: When the check is placed in the parent step and the child step asserts, the check becomes invalid.
When the check is placed in the parent step and the child step asserts, the check becomes invalid.
Aug 27, 2024
or
run the code, the step dddd won't executed , just as below:
The text was updated successfully, but these errors were encountered: