Skip to content

Commit 8e34ccb

Browse files
committed
test setter
1 parent ebb9282 commit 8e34ccb

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/idom/_option.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -125,17 +125,15 @@ def __init__(self, message: str, *args: Any, **kwargs: Any) -> None:
125125
super().__init__(*args, **kwargs)
126126

127127
@property # type: ignore
128-
def _current(self) -> _O:
128+
def current(self) -> _O:
129129
warn(
130130
self._deprecation_message,
131131
DeprecationWarning,
132132
stacklevel=_frame_depth_in_module() + 1,
133133
)
134-
return self._new_opt.current
134+
return super().current
135135

136-
@_current.setter
137-
def _current(self, new: _O) -> None:
138-
self._new_opt.current = new
136+
current = current.setter(Option.current.fset)
139137

140138

141139
def _frame_depth_in_module() -> int:

tests/test__option.py

+3
Original file line numberDiff line numberDiff line change
@@ -106,3 +106,6 @@ def test_deprecated_option():
106106

107107
with pytest.warns(DeprecationWarning, match="is deprecated!"):
108108
opt.current
109+
110+
with pytest.warns(DeprecationWarning, match="is deprecated!"):
111+
opt.current = "something"

0 commit comments

Comments
 (0)