Skip to content

Commit

Permalink
Merge pull request #37 from rsokl/test-methods-section
Browse files Browse the repository at this point in the history
test Methods section in numpy docstring
  • Loading branch information
rsokl authored Jan 24, 2021
2 parents 589d864 + 86aac7e commit 9c9aa86
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions tests/default_styles_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,43 @@ def child():
assert custom_inherit.store["numpy_napoleon"](prnt.__doc__, child.__doc__) == out


def test_methods_section_in_numpy():
from custom_inherit import DocInheritMeta
from six import add_metaclass

@add_metaclass(metaclass=DocInheritMeta(style="numpy_with_merge"))
class Parent:
"""Parent summary.
Methods
-------
meth
"""
pass

class Child(Parent):
"""Child summary.
Attributes
----------
a: hello
"""
pass

c = Child()
expected = """Child summary.
Attributes
----------
a: hello
Methods
-------
meth"""
assert c.__doc__ == expected


def test_google_napoleon():
def prnt():
""" first line
Expand Down

0 comments on commit 9c9aa86

Please sign in to comment.