-
Notifications
You must be signed in to change notification settings - Fork 124
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
Deprecate proc
kwarg to call_historic()
#143
Conversation
686c419
to
54fdbfc
Compare
If ``proc`` is not None it will be called for for each non-None result | ||
obtained from a hook implementation. | ||
If ``result_callback`` is not ``None`` it will be called for for each | ||
non-None result obtained from a hook implementation. |
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.
Please document that proc
is deprecated in the docstring 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.
Will do!
testing/test_pluginmanager.py
Outdated
he_method1.call_historic(proc=callback, kwargs=dict(arg=1)) | ||
|
||
# TODO: remove once ``proc`` is removed | ||
if callback: |
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.
For completeness we should also test passing result_callback
. I suggest changing this test to use result_callback
and create a new, simpler test, just for the deprecation.
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.
Sure thing!
54fdbfc
to
af30960
Compare
@nicoddemus pushed all your recs. |
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.
Great work!
pluggy/hooks.py
Outdated
return | ||
# XXX: woah isn't this wrong for `firstresult` hooks? |
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 btw did you notice this?
If i'm reading this correctly won't this code never process firstresult
hooks?
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.
Yeah I think that loop expr is just slightly wrong should be for x in res or [res]:
right?
Nope hehe.
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.
Oh waitttt whatttt?
Wait why not? I guess it doesn't make sense to?
pluggy/hooks.py
Outdated
self._call_history.append((kwargs or {}, proc)) | ||
if proc is not None: | ||
warnings.warn( | ||
"Support for `proc` argument now deprecated and will be" |
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.
Support for
proc
argument is now
dahhh!
af30960
to
0333b83
Compare
It's a bad name, use `result_callback` instead. Resolves pytest-dev#120
0333b83
to
6b296c2
Compare
@nicoddemus @RonnyPfannschmidt give this one more lookover if you don't mind. I tweaked couple things and added docs. |
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.
LGTM! 😁
It's a bad name, use
result_callback
instead.Resolves #120