Skip to content

Commit

Permalink
Remove deprecated _Result.result
Browse files Browse the repository at this point in the history
  • Loading branch information
bluetech committed Jun 4, 2020
1 parent 016e410 commit 0f7b260
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 15 deletions.
3 changes: 3 additions & 0 deletions changelog/TBD.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``.
8 changes: 0 additions & 8 deletions src/pluggy/callers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
Call loop machinery
"""
import sys
import warnings

_py3 = sys.version_info > (3, 0)

Expand Down Expand Up @@ -37,13 +36,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

0 comments on commit 0f7b260

Please sign in to comment.