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

StepYieldError when step ids are present in other parameter ids #21

Closed
smarie opened this issue Nov 24, 2018 · 0 comments
Closed

StepYieldError when step ids are present in other parameter ids #21

smarie opened this issue Nov 24, 2018 · 0 comments
Labels
bug Something isn't working

Comments

@smarie
Copy link
Owner

smarie commented Nov 24, 2018

import pytest
from pytest_steps import test_steps

@test_steps('a', 'b')
@pytest.mark.parametrize('dummy_param', ['a', 'b'], ids="p={}".format)
def test_step_id_conflicts(dummy_param):
    yield 'a'
    yield 'b'

yields:

StepYieldError: Error collecting results from step 'b': received 'a' from the `yield` statement, which is different from the current step or step name. Please either use `yield`, `yield 'b'` or wrap your step with `with optional_step(...) as my_step:` and use `yield my_step`

The issue happens because we generate a unique id for each combination of parameters except step. This unique id is based on the string id right now, where a conflict happens because the string id of the step parameter happends in the string id of the other.

@smarie smarie added the bug Something isn't working label Nov 24, 2018
@smarie smarie closed this as completed in dc850a6 Nov 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant