mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
gh-112205: Support docstring for @getter
(#113160)
--------- Co-authored-by: Erlend E. Aasland <erlend@python.org>
This commit is contained in:
parent
5a7cc667f8
commit
57b7e52790
7 changed files with 265 additions and 61 deletions
|
@ -2221,6 +2221,21 @@ class ClinicParserTest(TestCase):
|
|||
expected_error = f"{annotation} method cannot define parameters"
|
||||
self.expect_failure(block, expected_error)
|
||||
|
||||
def test_setter_docstring(self):
|
||||
block = """
|
||||
module foo
|
||||
class Foo "" ""
|
||||
@setter
|
||||
Foo.property
|
||||
|
||||
foo
|
||||
|
||||
bar
|
||||
[clinic start generated code]*/
|
||||
"""
|
||||
expected_error = "docstrings are only supported for @getter, not @setter"
|
||||
self.expect_failure(block, expected_error)
|
||||
|
||||
def test_duplicate_getset(self):
|
||||
annotations = ["@getter", "@setter"]
|
||||
for annotation in annotations:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue