Skip to content

How to report the step as skipped in pytest allure.step. #2155

Closed Answered by delatrie
dhavallad asked this question in Questions & Support
Discussion options

You must be logged in to vote

There is no convenient API for that at the moment but it's still doable. Just catch pytest.skip.Exception:

import allure, pytest

def test_discussion2155_example():
    try:
        with allure.step("A skipped step"):
            pytest.skip("Skipped due to a previous error")
    except pytest.skip.Exception:
        pass

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@dhavallad
Comment options

Answer selected by baev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants