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

How to use parameterized fixtures in pytest-bdd #618

Open
Hari-G-S opened this issue May 24, 2023 · 1 comment
Open

How to use parameterized fixtures in pytest-bdd #618

Hari-G-S opened this issue May 24, 2023 · 1 comment
Labels

Comments

@Hari-G-S
Copy link

I am trying to use parameterized fixture in my pytest-bdd framework. Normal fixture works fine. But If I am passing parameters, it gives below error

""The requested fixture has no parameter defined for test:""

Below is my code(Sample). Waht is the correct usage here?

@pytest.fixture(params=[1,2])
def ba_data(request):
print("this is fixture")
return request.param

@given(parsers.cfparse('Collect testdata'))
def required_data(ba_data):
print(ba_data)

actual need behind this:
I wanted to run entrire scenario multiple times, with dynamically generated data

@shaunc
Copy link

shaunc commented Jun 25, 2024

I'm getting this same issue using pytest-cases

@jsa34 jsa34 added the question label Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants