pytest-dev / pytest-dev/pluggy

evolve hook tracing by providing the concept of hook exec/call tracers

Open
#588 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1.7k
Forks
160
Avg merge
21h 4m
Merged PRs (30d)
6

Description

with the evolution attempts in the claude pr #584 i arrived at an idea to help better trace what hooks get called

instead of adding before/after function

we will have internal hook wrappers following a spec of

@hookspec(wrapper=True)
def pluggy_trace_hookexec(hook_name: str,
            hooks: Sequence[HookImpl],
            wrappers: Sequence[WrapperImpl],
            kwargs: Mapping[str, object],
            firstresult: bool):...


   code before any hook gets called
   result = yield
   after all hooks have executed
   # no result mod allowed


@hookspec(wrapper=True)
def pluggy_trace_hook_wrapper(wrapper: WrapperImpl): ...
   before wrapper is active
   result = yield
   after wrapper is donr



@hookspec(wrapper=True)
def pluggy_trace_hook_wrapper(hook: HookImpl): ...
   before hook was called
   result = yield
   after hook was called

note - we may choose to add additional arguments to ensure a good developer experience

i just added the minium needed to get started

Contributor guide

No contributing guide indexed for this repository

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.

Research direction

Start by reviewing the evolution attempts in Claude PR #584 and the proposed hook wrapper specifications in this issue. Compare the hook-execution, hook-wrapper, and individual-hook tracing concepts, then clarify the API and arguments with maintainers. Done means an agreed tracing design with defined behavior for execution and wrapper boundaries.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.