pytest-dev / pytest-dev/pytest

Expose FixtureFunctionDefinition as part of the public API

Open
#14,853 14 comments 0 reactions 1 assignee View on GitHub

@teddygood is already working on this.

Since Aug 11, 2026.

good first issue topic: fixtures
Dominant language
Python
Stars
14.5k
Forks
3.4k
Avg merge
2d 9h
Merged PRs (30d)
35

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.