-
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
Re-add _Result.result as an attr which triggers a deprecation warning #88
Conversation
@nicoddemus I'm fine with either tbh. |
in this case i am against properties, as a property doesn't have this implication of work or failure from my pov a property is something that should always work the |
pluggy/callers.py
Outdated
def result(self): | ||
"""Get the result(s) for this hook call (DEPRECATED in favor of ``get_result()``).""" | ||
msg = 'Use get_result() which forces correct exception handling' | ||
warnings.warn(DeprecationWarning(msg)) |
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.
this needs a stacklevel set to point at the right place
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 set the correct stacklevel
Fixed warning's stacktrace, thanks for noticing @RonnyPfannschmidt |
👍 |
This should fix the
pluggymaster
environment in pytest.Guys I was wondering if it wouldn't be better instead of
get_result()
to haveresult
as a read-only property, with the same semantics asget_result()
?outcome.result
is more user-friendly thanoutcome.get_result()
. It seems we are not using one of the key benefits of properties of being able to change an attribute access into a property at some later time without breaking users.