Skip to content

Commit

Permalink
fix docstring test
Browse files Browse the repository at this point in the history
The logic for finding the docstring line number seems to no longer work.
  • Loading branch information
dhellmann committed Dec 19, 2024
1 parent 596dfc2 commit b86d87a
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions tests/test_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,18 +359,7 @@ def public_function(arg_name):
"contents",
)

# Sphinx 5.1.0 and later reports line numbers for docstring
# content.
line_num = "None:"
if sphinx.version_info[:3] >= (5, 1, 0):
line_num = "1:"

# Expected string is too long for one line
expected = (
("the_source.py:" "docstring of the_source.public_function:")
+ line_num
+ (" (vaule)")
)
expected = "src/contents.rst:3: (vaule) Pass a vaule\n"
assert expected in output_text


Expand Down

0 comments on commit b86d87a

Please sign in to comment.