-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
multi hook registration does not unregister #431
Comments
Hi @RonnyPfannschmidt . I added the following test case in test_hookcaller.py but this did not result in test failure. Am I misunderstanding the (brief) description on this bug?
I'm new to this project and hoping to help out somewhere. This looked like a spot to jump in ... |
Please validate both hooks are actually registered,I believe there's a second issue at Hand |
Ok. I will compare your feedback to the code and see what else I can check in order to confirm that both implementations are actually registered. The test case does already confirm that:
I will take a look to see what other aspects I can confirm (perhaps something in tracing or other utils). |
@RonnyPfannschmidt - I've added additional testing but still do not see any test failures. I've added:
Rather than paste new code here for you to look at, I've created a Draft PR #446 |
PS, I finally figured why it's working, Unregister collects hook callers for plugins multiple times if there's multiple registration, thus in turn unregister is called multiple times |
Yes! before I wrote the test cases, I wrote a change for that for loop so
it would remove all matches instead of just the first. I was disappointed
that it fixed nothing (and actually broke deregistration since now the
outer loop would still run twice and second time would fail due to the
overzealous first remove pass). :)
Good code around here. Enjoying the project so far. Cheers!
…On Fri, Sept 22, 2023, 10:55 a.m. Ronny Pfannschmidt < ***@***.***> wrote:
PS, I finally figured why it's working,
Unregister collects hook callers for plugins multiple times if there's
multiple registration, thus in turn unregister is called multiple times
—
Reply to this email directly, view it on GitHub
<#431 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABFYUNXXVGVH5YS25XQEGU3X3WRF7ANCNFSM6AAAAAA3PSRJ7Y>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
#251 added having multiple hooks of the same name to a plugin
https://github.com/pytest-dev/pluggy/blob/475c4aa99200bfa3e30d12458ab2a3593a36dd56/src/pluggy/_hooks.py#L417-L422C57 does not unregister them
The text was updated successfully, but these errors were encountered: