Skip to content

Expose FixtureFunctionDefinition as part of the public API - #14876

Closed
Skeletor-Pirate wants to merge 2 commits into
pytest-dev:mainfrom
Skeletor-Pirate:expose-fixture-function-definition
Closed

Expose FixtureFunctionDefinition as part of the public API#14876
Skeletor-Pirate wants to merge 2 commits into
pytest-dev:mainfrom
Skeletor-Pirate:expose-fixture-function-definition

Conversation

@Skeletor-Pirate

Copy link
Copy Markdown

Closes #14853.

There is no public type to annotate the return value of @pytest.fixture-decorated functions or fixture factories; users had to reach into _pytest.fixtures.FixtureFunctionDefinition. This exposes it as pytest.FixtureFunctionDefinition.

Changes

  • src/pytest/__init__.py: import FixtureFunctionDefinition and add it to __all__.
  • doc/en/reference/reference.rst: document it alongside the other fixture types.
  • testing/python/fixtures.py: add a test covering the public import, __all__ membership, and its use as a return annotation.
  • changelog/14853.feature.rst: feature changelog entry.

Verification

  • python -m pytest testing/python/fixtures.py → 240 passed, 2 skipped, 2 xfailed (includes the new test).
  • import pytest; pytest.FixtureFunctionDefinition resolves and is present in pytest.__all__.

@psf-chronographer psf-chronographer Bot added the bot:chronographer:provided (automation) changelog entry is part of PR label Aug 13, 2026
@RonnyPfannschmidt

Copy link
Copy Markdown
Member

ai dos attack

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:chronographer:provided (automation) changelog entry is part of PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose FixtureFunctionDefinition as part of the public API

2 participants