Skip to content

mocker fixture cannot be used in module scope #136

@aleGpereira

Description

@aleGpereira

If i define a custom fixture like:

@pytest.fixture(scope='module')
def my_fixture(mocker):
// code using mocker

class TestMyModule(object):

def test_one(self, my_fixture): // test code 

When i run this i get:
ScopeMismatch: You tried to access the 'function' scoped fixture 'mocker' with a 'module' scoped request object, involved factories

I'm i doing something wrong to do something like this? is there some reason why this is not supported?

Thanks.

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