gh-112205: Support docstring for @getter (#113160)

---------

Co-authored-by: Erlend E. Aasland <erlend@python.org>
This commit is contained in:
Donghee Na 2023-12-20 12:52:12 +00:00 committed by GitHub
parent 5a7cc667f8
commit 57b7e52790
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 265 additions and 61 deletions

View file

@ -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: