Re-add _Result.result as an attr which triggers a deprecation warning#88
Merged
goodboy merged 2 commits intopytest-dev:masterfrom Sep 16, 2017
Merged
Re-add _Result.result as an attr which triggers a deprecation warning#88goodboy merged 2 commits intopytest-dev:masterfrom
goodboy merged 2 commits intopytest-dev:masterfrom
Conversation
Contributor
|
@nicoddemus I'm fine with either tbh. |
goodboy
approved these changes
Sep 12, 2017
Member
|
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)) |
Member
There was a problem hiding this comment.
this needs a stacklevel set to point at the right place
RonnyPfannschmidt
requested changes
Sep 13, 2017
Member
RonnyPfannschmidt
left a comment
There was a problem hiding this comment.
please set the correct stacklevel
Member
Author
|
Fixed warning's stacktrace, thanks for noticing @RonnyPfannschmidt |
Member
|
👍 |
This was referenced Nov 24, 2017
This was referenced Dec 8, 2017
This was referenced Dec 20, 2017
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This should fix the
pluggymasterenvironment in pytest.Guys I was wondering if it wouldn't be better instead of
get_result()to haveresultas a read-only property, with the same semantics asget_result()?outcome.resultis 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.