Skip to content

session scoped fixtures get executed multiple times. I suspect I am using pytest wrong #1878

@do3cc

Description

@do3cc

Hi,

I am using pytest 3.0.1.

I've created a lot of test fixtures and wanted to push them to module scope.
I now see exceptions that show that they get executed twice.

I suspect that by importing my fixtures from one test module to another, I created a second session scoped fixture.

So in test_a.py I do:

fixture
def a():
    pass

and in test_b.py I do:

from .test_a import a

def test_lala(a):
    pass

Can you confirm my suspicion?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions