Home | History | Annotate | Download | only in python2.7

Lines Matching refs:docstring

107 #  - Example: a <source, want> pair, plus an intra-docstring line number.
108 # - DocTest: a collection of examples, parsed from a docstring, plus
109 # info about where the docstring came from (name, filename, lineno).
110 # - DocTestFinder: extracts DocTests from a given object's docstring and
398 ## a string (such as an object's docstring). The DocTest class also
484 the object whose docstring this DocTest was extracted from).
494 - docstring: The string that the examples were extracted from,
497 def __init__(self, examples, globs, name, filename, lineno, docstring):
505 self.docstring = docstring
526 self.docstring == other.docstring and \
536 return hash((self.docstring, self.name, self.filename, self.lineno))
763 raise ValueError('line %r of the docstring for %s '
775 raise ValueError('line %r of the docstring for %s has '
787 object, from its docstring and the docstrings of its contained
818 object's docstring, or by any of its contained objects'
868 # given object's docstring.
993 Return a DocTest for the given object, if it defines a docstring;
996 # Extract the object's docstring. If it doesn't have one,
999 docstring = obj
1003 docstring = ''
1005 docstring = obj.__doc__
1006 if not isinstance(docstring, basestring):
1007 docstring = str(docstring)
1009 docstring = ''
1011 # Find the docstring's location in the file.
1014 # Don't bother if the docstring is empty.
1015 if self._exclude_empty and not docstring:
1025 return self._parser.get_doctest(docstring, globs, name,
1030 Return a line number of the given object's docstring. Note:
1031 this method assumes that the object has a docstring.
1060 # Find the line number where the docstring starts. Assume
1819 dict is actually used for each docstring, so that each docstring's
1932 is actually used for each docstring, so that each docstring's
2026 Test examples in the given object's docstring (`f`), using `globs`
2605 docstring as a script.
2617 testsrc = script_from_examples(test.docstring)
2621 """Debug a single doctest docstring, in argument `src`'"""
2658 """Debug a single doctest docstring.
2662 with the docstring with tests to be debugged.
2673 A pointless class, for sanity-checking of docstring testing.