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
424 ## a string (such as an object's docstring). The DocTest class also
510 the object whose docstring this DocTest was extracted from).
520 - docstring: The string that the examples were extracted from,
523 def __init__(self, examples, globs, name, filename, lineno, docstring):
531 self.docstring = docstring
552 self.docstring == other.docstring and \
562 return hash((self.docstring, self.name, self.filename, self.lineno))
789 raise ValueError('line %r of the docstring for %s '
801 raise ValueError('line %r of the docstring for %s has '
813 object, from its docstring and the docstrings of its contained
844 object's docstring, or by any of its contained objects'
894 # given object's docstring.
1019 Return a DocTest for the given object, if it defines a docstring;
1022 # Extract the object's docstring. If it doesn't have one,
1025 docstring = obj
1029 docstring = ''
1031 docstring = obj.__doc__
1032 if not isinstance(docstring, basestring):
1033 docstring = str(docstring)
1035 docstring = ''
1037 # Find the docstring's location in the file.
1040 # Don't bother if the docstring is empty.
1041 if self._exclude_empty and not docstring:
1051 return self._parser.get_doctest(docstring, globs, name,
1056 Return a line number of the given object's docstring. Note:
1057 this method assumes that the object has a docstring.
1086 # Find the line number where the docstring starts. Assume
1844 dict is actually used for each docstring, so that each docstring's
1957 is actually used for each docstring, so that each docstring's
2051 Test examples in the given object's docstring (`f`), using `globs`
2630 """Extract the test sources from a doctest docstring as a script.
2642 testsrc = script_from_examples(test.docstring)
2646 """Debug a single doctest docstring, in argument `src`'"""
2683 """Debug a single doctest docstring.
2687 with the docstring with tests to be debugged.
2698 A pointless class, for sanity-checking of docstring testing.