Skip to content

Fix hooks surviving historic replay cancellation - #811

Open
tridev-tej wants to merge 3 commits into
pytest-dev:mainfrom
tridev-tej:tejesh/fix-historic-registration-cancellation
Open

tridev-tej wants to merge 3 commits into
pytest-dev:mainfrom
tridev-tej:tejesh/fix-historic-registration-cancellation

Conversation

@tridev-tej

Copy link
Copy Markdown

Plugins unregistered or blocked during historic replay could leave hooks active.

Stop the cancelled registration before installing more hooks, while preserving replay order and nested replacements.

@Muguett-DBY Muguett-DBY left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked d63d7491 on Windows with CPython 3.12.14.

  • uv run pytest: 260 passed, with pytest plugin autoload disabled.
  • I compared the base and this head across eight cases: unregistering or blocking during a historic implementation or its result callback, with and without a replacement registered under the same name. The base leaves the old historic and ordinary hook implementations active; this head removes them while retaining the unrelated plugin and, where applicable, the replacement.

No issue found in that scope. I haven't independently tested other Python versions or platforms. Codex helped with the source review and checks.

@tridev-tej

Copy link
Copy Markdown
Author

@Pierre-Sassoulas any further feedback on this, or is it good to merge?

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.

2 participants