Skip to content

Expose FixtureFunctionDefinition as part of the public API #14853

Description

@adamtheturtle

There doesn’t appear to be a public type that can be used to annotate the result of pytest.fixture.

For example, consider a factory which creates fixtures:

from _pytest.fixtures import FixtureFunctionDefinition

def make_fixture(value: str) -> FixtureFunctionDefinition:
    @pytest.fixture
    def fixture() -> str:
        return value
    return fixture

Metadata

Metadata

Assignees

Labels

good first issueeasy issue that is friendly to new contributortopic: fixturesanything involving fixtures directly or indirectly

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions