File tree 1 file changed +12
-1
lines changed
1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -1279,9 +1279,18 @@ def no_period(self):
1279
1279
""" )
1280
1280
1281
1281
1282
- def test_class_members_as_member_list ():
1282
+ def test_class_attributes_as_member_list ():
1283
1283
1284
1284
class Foo :
1285
+ """
1286
+ Class docstring.
1287
+
1288
+ Attributes
1289
+ ----------
1290
+ an_attribute
1291
+ Another description that is not used.
1292
+
1293
+ """
1285
1294
@property
1286
1295
def an_attribute (self ):
1287
1296
"""Test attribute"""
@@ -1293,6 +1302,7 @@ def an_attribute(self):
1293
1302
Test attribute"""
1294
1303
1295
1304
assert attr_doc in str (SphinxClassDoc (Foo ))
1305
+ assert "Another description" not in str (SphinxClassDoc (Foo ))
1296
1306
1297
1307
attr_doc2 = """.. rubric:: Attributes
1298
1308
@@ -1303,6 +1313,7 @@ def an_attribute(self):
1303
1313
1304
1314
cfg = dict (attributes_as_param_list = False )
1305
1315
assert attr_doc2 in str (SphinxClassDoc (Foo , config = cfg ))
1316
+ assert "Another description" not in str (SphinxClassDoc (Foo , config = cfg ))
1306
1317
1307
1318
1308
1319
def test_templated_sections ():
You can’t perform that action at this time.
0 commit comments