You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[<DocTest example from example.py:5 (no examples)>,
<DocTest example.a from example.py:5 (no examples)>,
<DocTest example.b from example.py:5 (no examples)>,
<DocTest example.c from example.py:None (no examples)>]
whereas if one uncomments the docstrings of a and c the output is
[<DocTest example from example.py:1 (no examples)>,
<DocTest example.a from example.py:1 (no examples)>,
<DocTest example.b from example.py:5 (no examples)>,
<DocTest example.c from example.py:9 (no examples)>]
This bug is due to this line in doctest:
lineno=self._find_lineno(obj, source_lines)
The documentation of _find_lineno says this:
def_find_lineno(self, obj, source_lines):
""" Return a line number of the given object's docstring. Note: this method assumes that the object has a docstring. """
This assumption is violated by the call listed above, because of the exclude_empty=False parameter to DocTestFinder().
I guess lineno should just be None for all methods that do not have a docstring?
lineno
location for emptyDocTest
instances #30498Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: