Skip to content

Improve lookup/request to allow access to class instances from staticfunctions #3720

@nicoddemus

Description

@nicoddemus

Follow up from #3705 (comment)

We would like to cleanup the __being_called_by_pytest keyword hack that was used in #3705. @RonnyPfannschmidt's suggestion of unwrapping the fixture function just before the call works great, except that for staticmethods we don't have access to instance request at that point.

It seems like a deeper issue in the structural construction of the request: static test functions should still have self in request.instance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: fixturesanything involving fixtures directly or indirectlytype: refactoringinternal improvements to the code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions