How to report the step as skipped in pytest allure.step. #2155
-
import pytest
def test_sample(self):
with pytest.allure.step('Step 1'):
pass
try:
with pytest.allure.step('Step 2'):
raise Exception('Error')
except:
pass
with pytest.allure.step('Step 3'):
# I want to skip this step and report it as skipped in the allure report. Using pytest.skip() is reporting the entire test as skipped.
pass |
Beta Was this translation helpful? Give feedback.
Answered by
delatrie
Oct 17, 2023
Replies: 1 comment 1 reply
-
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
baev
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There is no convenient API for that at the moment but it's still doable. Just catch
pytest.skip.Exception
: