Skip to content

BUG: Properly parse See Also when summary on first line. #282

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions numpydoc/docscrape.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,8 @@ def _parse_see_also(self, content):

"""

content = dedent_lines(content)

items = []

def parse_item_name(text):
Expand Down
8 changes: 4 additions & 4 deletions numpydoc/tests/test_docscrape.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
)
from numpydoc.docscrape_sphinx import (SphinxDocString, SphinxClassDoc,
SphinxFunctionDoc, get_doc_object)
import pytest
from pytest import raises as assert_raises
from pytest import warns as assert_warns

Expand Down Expand Up @@ -766,11 +767,10 @@ def test_warns():
assert param.type == 'SomeWarning'
assert param.desc == ['If needed']


def test_see_also():
@pytest.mark.parametrize('prefix', ['', '\n '])
def test_see_also(prefix):
doc6 = NumpyDocString(
"""
z(x,theta)
prefix + """z(x,theta)

See Also
--------
Expand Down