File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -1179,6 +1179,32 @@ def no_period(self):
11791179 """ )
11801180
11811181
1182+ def test_class_members_as_member_list ():
1183+
1184+ class Foo :
1185+ @property
1186+ def an_attribute (self ):
1187+ """Test attribute"""
1188+ return None
1189+
1190+ attr_doc = """:Attributes:
1191+
1192+ :obj:`an_attribute <an_attribute>`
1193+ Test attribute"""
1194+
1195+ assert attr_doc in str (SphinxClassDoc (Foo ))
1196+
1197+ attr_doc2 = """.. rubric:: Attributes
1198+
1199+ .. autosummary::
1200+ :toctree:
1201+
1202+ an_attribute"""
1203+
1204+ cfg = dict (attributes_as_param_list = False )
1205+ assert attr_doc2 in str (SphinxClassDoc (Foo , config = cfg ))
1206+
1207+
11821208def test_templated_sections ():
11831209 doc = SphinxClassDoc (None , class_doc_txt ,
11841210 config = {'template' : jinja2 .Template ('{{examples}}\n {{parameters}}' )})
You can’t perform that action at this time.
0 commit comments