Skip to content
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

Remove deprecated _Result.result #265

Merged
merged 1 commit into from
Jun 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions changelog/265.removal.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Remove the ``_Result.result`` property. Use ``_Result.get_result()`` instead.
Note that unlike ``result``, ``get_result()`` raises the exception if the hook raised.
The deprecation was announced in release ``0.6.0``.
7 changes: 0 additions & 7 deletions src/pluggy/_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,6 @@ def __init__(self, result, excinfo):
def excinfo(self):
return self._excinfo

@property
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), stacklevel=2)
return self._result

@classmethod
def from_call(cls, func):
__tracebackhide__ = True
Expand Down
7 changes: 0 additions & 7 deletions testing/test_deprecations.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,12 @@
Deprecation warnings testing roundup.
"""
import pytest
from pluggy.callers import _Result
from pluggy import PluginManager, HookimplMarker, HookspecMarker

hookspec = HookspecMarker("example")
hookimpl = HookimplMarker("example")


def test_result_deprecated():
r = _Result(10, None)
with pytest.deprecated_call():
assert r.result == 10


def test_implprefix_deprecated():
with pytest.deprecated_call():
pm = PluginManager("blah", implprefix="blah_")
Expand Down