Skip to content

Commit d66246f

Browse files
committed
FIX: Fixes after rebase
1 parent 7b0a03f commit d66246f

File tree

4 files changed

+15
-16
lines changed

4 files changed

+15
-16
lines changed

doc/conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
version = re.sub(r'(\d+\.\d+)\.\d+(.*)', r'\1\2', numpydoc.__version__)
8484
version = re.sub(r'(\.dev\d+).*?$', r'\1', version)
8585
numpydoc_xref_param_type = True
86-
numpydoc_xref_ignore = {'optional'}
86+
numpydoc_xref_ignore = {'optional', 'type_without_description', 'BadException'}
8787

8888
# The language for content autogenerated by Sphinx. Refer to documentation
8989
# for a list of supported languages.

numpydoc/docscrape_sphinx.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -230,10 +230,10 @@ def _str_param_list(self, name, fake_autosummary=False):
230230
param_type,
231231
self.xref_aliases,
232232
self.xref_ignore)
233-
(??) out += self._str_indent(['%s : %s' % (display_param,
234-
(??) param.type)])
235-
(??) else:
236-
(??) out += self._str_indent([display_param])
233+
out += self._str_indent(['%s : %s' % (display_param,
234+
param_type)])
235+
else:
236+
out += self._str_indent([display_param])
237237
if desc and self.use_blockquotes:
238238
out += ['']
239239
elif not desc:

numpydoc/tests/test_docscrape.py

+6-10
Original file line numberDiff line numberDiff line change
@@ -383,11 +383,11 @@ def _strip_blank_lines(s):
383383
return s
384384

385385

386-
def line_by_line_compare(a, b):
386+
def line_by_line_compare(a, b, n_lines=None):
387387
a = textwrap.dedent(a)
388388
b = textwrap.dedent(b)
389-
a = [l.rstrip() for l in _strip_blank_lines(a).split('\n')]
390-
b = [l.rstrip() for l in _strip_blank_lines(b).split('\n')]
389+
a = [l.rstrip() for l in _strip_blank_lines(a).split('\n')][:n_lines]
390+
b = [l.rstrip() for l in _strip_blank_lines(b).split('\n')][:n_lines]
391391
assert len(a) == len(b)
392392
for ii, (aa, bb) in enumerate(zip(a, b)):
393393
assert aa == bb
@@ -519,8 +519,7 @@ def test_yield_str():
519519
The number of bananas.
520520
int
521521
The number of unknowns.
522-
523-
.. index:: """)
522+
""")
524523

525524

526525
def test_receives_str():
@@ -538,8 +537,7 @@ def test_receives_str():
538537
The number of bananas.
539538
c : int
540539
The number of oranges.
541-
542-
.. index:: """)
540+
""")
543541

544542

545543
def test_no_index_in_str():
@@ -1186,8 +1184,6 @@ def test_class_members_doc():
11861184
b
11871185
c
11881186
1189-
.. index::
1190-
11911187
""")
11921188

11931189

@@ -1371,7 +1367,7 @@ def test_autoclass():
13711367
.. rubric:: Methods
13721368
13731369
1374-
''')
1370+
''', 5)
13751371

13761372

13771373
xref_doc_txt = """

numpydoc/tests/test_numpydoc.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ class MockConfig():
1010
numpydoc_show_class_members = True
1111
numpydoc_show_inherited_class_members = True
1212
numpydoc_class_members_toctree = True
13+
numpydoc_xref_param_type = False
14+
numpydoc_xref_aliases = {}
15+
numpydoc_xref_ignore = set()
1316
templates_path = []
1417
numpydoc_edit_link = False
1518
numpydoc_citation_re = '[a-z0-9_.-]+'
@@ -40,7 +43,7 @@ def test_mangle_docstrings():
4043
doc = mangle_docstrings(MockApp(), 'class', 'str', str, {'members': ['upper']}, lines)
4144
assert 'rpartition' not in [x.strip() for x in lines]
4245
assert 'upper' in [x.strip() for x in lines]
43-
46+
4447
lines = s.split('\n')
4548
doc = mangle_docstrings(MockApp(), 'class', 'str', str, {'exclude-members': ALL}, lines)
4649
assert 'rpartition' not in [x.strip() for x in lines]

0 commit comments

Comments
 (0)