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

In pytest.mark.parametrize(), how do I pass list-type data returned by a fixture to param as an iterable? #13209

Open
1999reddy opened this issue Feb 9, 2025 · 1 comment

Comments

@1999reddy
Copy link

`
import pytest
from pytest_lazy_fixtures import lf

@pytest.fixture(scope='session', params=[[1, 2], [3, 4], [5, 6]])
def zero(request):
print('zero begin')
print('zero:', request.param)

return request.param

@pytest.mark.parametrize('two', lf('zero'))
def test_func(two):
print('receive:', two))
pass

if name == 'main':
pytest.main()

`

Image

@RonnyPfannschmidt
Copy link
Member

Parameterize happens before fixtures

So they aren't avaliable for it

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

No branches or pull requests

2 participants