File tree Expand file tree Collapse file tree 1 file changed +50
-0
lines changed Expand file tree Collapse file tree 1 file changed +50
-0
lines changed Original file line number Diff line number Diff line change @@ -240,6 +240,56 @@ class Child(Mixin, Parent):
240
240
)
241
241
242
242
243
+ def test_class_docstring_merge_hierarchy_numpy ():
244
+ @add_metaclass (DocInheritMeta (style = "numpy_with_merge" ))
245
+ class GrandParent (object ):
246
+ """GrandParent.
247
+
248
+ Attributes
249
+ ----------
250
+ foo
251
+ """
252
+
253
+ class Parent (GrandParent ):
254
+ """
255
+ Attributes
256
+ ----------
257
+ bar
258
+ """
259
+
260
+ class Child (Parent ):
261
+ pass
262
+
263
+ assert (
264
+ getdoc (Child )
265
+ == "GrandParent.\n \n Attributes\n ----------\n foo\n bar"
266
+ )
267
+
268
+
269
+ def test_class_docstring_merge_hierarchy_google ():
270
+ @add_metaclass (DocInheritMeta (style = "google_with_merge" ))
271
+ class GrandParent (object ):
272
+ """GrandParent.
273
+
274
+ Args:
275
+ foo
276
+ """
277
+
278
+ class Parent (GrandParent ):
279
+ """
280
+ Args:
281
+ bar
282
+ """
283
+
284
+ class Child (Parent ):
285
+ pass
286
+
287
+ assert (
288
+ getdoc (Child )
289
+ == "GrandParent.\n \n Parameters:\n foo\n bar"
290
+ )
291
+
292
+
243
293
""" Include special method option"""
244
294
245
295
@add_metaclass (DocInheritMeta (style = style , include_special_methods = True ))
You can’t perform that action at this time.
0 commit comments