Skip to content

fixture with scope “class” running for every method #2938

@grnmeira

Description

@grnmeira

I'm having a problem with fixture scopes and I wonder if this can be a bug. I'm running Pytest 3.2.5 with Python 3. I basically want to apply a fixture with scope "class" but parametrizing the fixture. The idea is to have groups of tests defined by classes, and to run those groups with different configurations. But when I apply also a fixture with scope "function", that seems to affect also the "class" fixture.

I have a question with an example code in Stack Overflow: https://stackoverflow.com/questions/47312835/pytest-fixture-with-scope-class-running-on-every-method

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: fixturesanything involving fixtures directly or indirectlytopic: parametrizerelated to @pytest.mark.parametrizetype: bugproblem that needs to be addressed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions