pytest-dev/pytest

Expose FixtureFunctionDefinition as part of the public API

Offen

#14.853 geöffnet am 11.08.2026

 (1 Kommentar) (0 Reaktionen) (1 zugewiesene Person)Python (2.476 Forks)batch import
good first issuetopic: fixtures

Repository-Metriken

Stars
 (11.012 Sterne)
PR-Merge-Metriken
 (Durchschn. Merge 4T 1h) (59 gemergte PRs in 30 T)

Beschreibung

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