pytest-dev/pytest

Expose FixtureFunctionDefinition as part of the public API

開放

#14,853 建立於 2026年8月11日

 (1 則留言) (0 個反應) (1 位負責人)Python (2,476 個分叉)batch import
good first issuetopic: fixtures

倉庫指標

星標
 (11,012 顆星)
PR 合併指標
 (平均合併 4天 1小時) (30 天內合併 59 個 PR)

描述

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

貢獻者指南