Skip to content

Pytest class scope fixture for a parametrized test called once for each parameter #1192

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

Closed
alnet82 opened this issue Nov 25, 2015 · 0 comments

Comments

@alnet82
Copy link

alnet82 commented Nov 25, 2015

fixt_finc fixture defined with class scope is being called twice - for every value of prm.
I expected it to be called only once. What am I missing here?

@pytest.fixture(scope='class')
def fixt_func(request, resource):
    print "fixt_func"

class TestA():
    @pytest.mark.parametrize('resource', ['x'], scope='class')
    @pytest.mark.parametrize('prm', ['a', 'b'])
    def test_a(self, prm, fixt_func)
        assert True
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

1 participant