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

Fixture scope doesn't work when it is parametrized #1697

bubanoid opened this Issue Jul 4, 2016 · 2 comments


None yet
4 participants
Copy link

bubanoid commented Jul 4, 2016

Please look at the following tests

import pytest

ind = [0]

def fixture_0(request):
    ind[0] += 1

@pytest.mark.parametrize('fixture_0', ['smth'], indirect=True)
def test_1(fixture_0):
    print('test_1:  ind={ind}'.format(ind=ind[0]))

def test_2(fixture_0):
    print('test_2:  ind={ind}'.format(ind=ind[0]))

and their output:

test_1:  ind=1
test_2:  ind=2

however I expected to get the

test_1:  ind=1
test_2:  ind=1

I guess it is a bug. This issue is connected to the issue #634 See also another presentation of this issue:


This comment has been minimized.

Copy link

RonnyPfannschmidt commented Jul 4, 2016

as far as i can tell this is exactly related to #634


This comment has been minimized.

Copy link

Stranger6667 commented Jul 26, 2016

After merging #1766 test above produces the following output:

collected 2 items[smth]

test_1:  ind=1
PASSED test_2:  ind=1

So, it is fixed as I see.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.