-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Verify hooks after collection completes #2292
Verify hooks after collection completes #2292
Conversation
Strange, Linux is breaking because |
d965620
to
7317767
Compare
Oh wow, so the error was that |
And not surprisingly some tests now fail because we are now detecting fd leaks again. 😅 That hookwrapper doesn't seem right as well, it is breaking the entire run instead of failing the offending test. |
@@ -54,7 +54,6 @@ def main(args=None, plugins=None): | |||
return 4 | |||
else: | |||
try: | |||
config.pluginmanager.check_pending() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we remove this check just because we added a new one at a different time in execution?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so, that was the main motivation of this PR (at least for me): to delay hook checking until we have loaded all plugins, included those delayed by the pytest_plugins
mechanism; this avoid having to write [deferred installation](https://docs.pytest.org/en/latest/writing_plugins.html#optionally-using-hooks-from-3rd-party-plugins mechanisms) if the hooks declared by other plugins are required by yours.
Also see #1821 for a detailed example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nicoddemus oh right, thanks for the reference, my understanding had been wrong
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No worries!
Do you or anybody else have any pointers on how to fix the tests leaking FDs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unfortunately not, does it hapen locally as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably, but I don't have a Linux box with me to check this now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is unrelated to this PR (the PR actually fixed the plugin and it is working again), should we create an issue for it and disable the plugin internally?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds good
…tecting leaked FDs Related to pytest-dev#2366
2951c59
to
5df340f
Compare
Just pass fslocation forward and let the hook implementer decide what to do with the parameter
5df340f
to
cac82e7
Compare
I think if nobody else wants to chime in, we can close this now. |
Fix #1821