Skip to content

Commit a2b6f65

Browse files
committed
Remove deprecated _Result.result
1 parent 016e410 commit a2b6f65

File tree

3 files changed

+3
-15
lines changed

3 files changed

+3
-15
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/callers.py

-8
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
Call loop machinery
33
"""
44
import sys
5-
import warnings
65

76
_py3 = sys.version_info > (3, 0)
87

@@ -37,13 +36,6 @@ def __init__(self, result, excinfo):
3736
def excinfo(self):
3837
return self._excinfo
3938

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-
4739
@classmethod
4840
def from_call(cls, func):
4941
__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)