Skip to content

feat(decorators): attach Hook*Configuration objects on marked functions - #706

Draft
RonnyPfannschmidt wants to merge 2 commits into
pytest-dev:mainfrom
RonnyPfannschmidt:refactor/markers-attach-config
Draft

RonnyPfannschmidt wants to merge 2 commits into
pytest-dev:mainfrom
RonnyPfannschmidt:refactor/markers-attach-config

Conversation

@RonnyPfannschmidt

@RonnyPfannschmidt RonnyPfannschmidt commented Jul 24, 2026 •

Copy link
Copy Markdown
Member

Written by Claude Opus 5.5 via Claude Code for the pluggy maintainers; I prompted it, it did the work, I read it.

Step 3 of 7, merges bottom-up: #703 → #704 → #706 → #707 → #708 → #709 → #710
The diff here is cumulative (steps 2–3); RonnyPfannschmidt#7 shows this step alone.

  • HookSpec stores its configuration as config; opts stays as a deprecated alias property. HookCaller reads config for firstresult.
  • Tests for the existing decoration-time rejection of historic + firstresult, and for the configuration the markers attach.

@RonnyPfannschmidt
RonnyPfannschmidt force-pushed the refactor/markers-attach-config branch 2 times, most recently from e406f69 to 5b654ff Compare July 24, 2026 16:54
@RonnyPfannschmidt
RonnyPfannschmidt force-pushed the refactor/markers-attach-config branch 3 times, most recently from 4dc4e1f to 5840c41 Compare August 12, 2026 11:14
@RonnyPfannschmidt
RonnyPfannschmidt marked this pull request as draft September 9, 2026 20:20
@RonnyPfannschmidt
RonnyPfannschmidt force-pushed the refactor/markers-attach-config branch from 5840c41 to 5bc4b9b Compare September 12, 2026 19:04
@RonnyPfannschmidt
RonnyPfannschmidt force-pushed the refactor/markers-attach-config branch from 5bc4b9b to bde4435 Compare September 12, 2026 19:14
@RonnyPfannschmidt
RonnyPfannschmidt force-pushed the refactor/markers-attach-config branch 3 times, most recently from f7bc9ce to 12db262 Compare September 24, 2026 11:24
RonnyPfannschmidt and others added 2 commits September 24, 2026 13:47
Markers attach HookspecConfiguration/HookimplConfiguration objects.
Registration discovers those privately; parse_hookimpl_opts and
parse_hookspec_opts remain a deprecated pytest concession that returns
legacy dicts and is only called when a subclass overrides them and no
modern configuration attribute was found.

Co-authored-by: Cursor AI <ai@cursor.sh>
Co-authored-by: Cursor Grok 4.5 <grok@cursor.com>
Complete design step 03: markers already attach configuration objects
since step 02; this finishes the step by storing the spec configuration
as HookSpec.config (try-claude naming) with a deprecated .opts alias,
reading .config in HookCaller firstresult resolution, and covering
decoration-time historic+firstresult validation and configuration
attachment with tests.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@RonnyPfannschmidt
RonnyPfannschmidt force-pushed the refactor/markers-attach-config branch from 12db262 to 3e694d7 Compare September 24, 2026 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant