We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6e8e279 commit 46ff8e6Copy full SHA for 46ff8e6
tests/test_property.py
@@ -220,6 +220,20 @@ class Example:
220
assert set(entry.keys()) == set(["get", "put"])
221
222
223
+def test_baseproperty_set_error():
224
+ """Check `.Baseproperty.__set__` raises an error and is overridden."""
225
+ assert tp.DataProperty.__get__ is tp.BaseProperty.__get__
226
+ assert tp.DataProperty.__set__ is not tp.BaseProperty.__set__
227
+ assert tp.FunctionalProperty.__set__ is not tp.BaseProperty.__set__
228
+
229
+ class Example:
230
+ bp: int = tp.BaseProperty()
231
232
+ example = Example()
233
+ with pytest.raises(NotImplementedError):
234
+ example.bp = 0
235
236
237
def test_decorator_exception():
238
r"""Check decorators work as expected when the setter has a different name.
239
0 commit comments