Skip to content

Commit de2669f

Browse files
committed
Remove deprecated _Result.result
1 parent f2cbf34 commit de2669f

File tree

3 files changed

+3
-14
lines changed

3 files changed

+3
-14
lines changed

changelog/265.removal.rst

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Remove the ``_Result.result`` property. Use ``_Result.get_result()`` instead.
2+
Note that unlike ``result``, ``get_result()`` raises the exception if the hook raised.
3+
The deprecation was announced in release ``0.6.0``.

src/pluggy/_result.py

-7
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,6 @@ def __init__(self, result, excinfo):
3737
def excinfo(self):
3838
return self._excinfo
3939

40-
@property
41-
def result(self):
42-
"""Get the result(s) for this hook call (DEPRECATED in favor of ``get_result()``)."""
43-
msg = "Use get_result() which forces correct exception handling"
44-
warnings.warn(DeprecationWarning(msg), stacklevel=2)
45-
return self._result
46-
4740
@classmethod
4841
def from_call(cls, func):
4942
__tracebackhide__ = True

testing/test_deprecations.py

-7
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,12 @@
22
Deprecation warnings testing roundup.
33
"""
44
import pytest
5-
from pluggy.callers import _Result
65
from pluggy import PluginManager, HookimplMarker, HookspecMarker
76

87
hookspec = HookspecMarker("example")
98
hookimpl = HookimplMarker("example")
109

1110

12-
def test_result_deprecated():
13-
r = _Result(10, None)
14-
with pytest.deprecated_call():
15-
assert r.result == 10
16-
17-
1811
def test_implprefix_deprecated():
1912
with pytest.deprecated_call():
2013
pm = PluginManager("blah", implprefix="blah_")

0 commit comments

Comments
 (0)