Skip to content

Commit 4cb6b23

Browse files
authored
Merge pull request #1 from stefmolin/patch-2
Add test to ensure that escaping trailing underscores in parameters is accounted for.
2 parents 22769ef + 7993209 commit 4cb6b23

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

numpydoc/tests/test_validate.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,29 @@ def valid_options_in_parameter_description_sets(self, bar):
482482
>>> result = 1 + 1
483483
"""
484484

485+
def parameters_with_trailing_underscores(self, str_):
486+
r"""
487+
Ensure PR01 and PR02 errors are not raised with trailing underscores.
488+
489+
Parameters with trailing underscores need to escape the them to render
490+
properly in the documentation since trailing underscores are used to
491+
create links.
492+
493+
Parameters
494+
----------
495+
str\_ : str
496+
Some text.
497+
498+
See Also
499+
--------
500+
related : Something related.
501+
502+
Examples
503+
--------
504+
>>> result = 1 + 1
505+
"""
506+
pass
507+
485508

486509
class BadGenericDocStrings:
487510
"""Everything here has a bad docstring"""

0 commit comments

Comments
 (0)