Skip to content

easier pattern for linter-friendly local fixtures #5645

Closed as not planned
Closed as not planned
@belm0

Description

@belm0

#1444 added a linter-friendly way to deal with locally defined fixtures, but it's rather cumbersome.

I'd like to see the fixture decorator ignore any leading underscore of the wrapped function. Then usage would be:

@pytest.fixture
def _my_fixture():
    ...

def test_foo(my_fixture):
    ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: fixturesanything involving fixtures directly or indirectlytype: proposalproposal for a new feature, often to gather opinions or design the API around the new feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions