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

Pytest marks on generator test step? #42

Open
dimko opened this issue Jun 29, 2021 · 2 comments
Open

Pytest marks on generator test step? #42

dimko opened this issue Jun 29, 2021 · 2 comments

Comments

@dimko
Copy link

dimko commented Jun 29, 2021

Hello, is it possible somehow when using generator steps to mark a specific step, for example, with the @pytest.mark.xfail, skip or other marks? Thank you in advance.

@dimko dimko changed the title Decorate generator test step? Pytest marks on generator test step? Jun 29, 2021
@smarie
Copy link
Owner

smarie commented Jun 29, 2021

Thanks @dimko for this feedback ! In the current version it is not possible to mark specific steps.

However you can use pytest.xfail() and pytest.skip() directly in the test code instead, this works fine (see documentation).

In the future, we could imagine to support usage of pytest.param(..., marks=) around each step name such as :

@test_steps('step_a', pytest.param('step_b', marks=pytest.mark.foo), 'step_c')
def test_blah():
    ...

I guess that this would be the most natural way to declare marks on specific steps.

@dimko
Copy link
Author

dimko commented Jun 29, 2021

Thanks @smarie!

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

No branches or pull requests

2 participants