doctest.DocTestParser.get_doctest()

get_doctest(string, globs, name, filename, lineno) Extract all doctest examples from the given string, and collect them into a DocTest object. globs, name, filename, and lineno are attributes for the new DocTest object. See the documentation for DocTest for more information.

doctest.DocTestParser

class doctest.DocTestParser A processing class used to extract interactive examples from a string, and use them to create a DocTest object. DocTestParser defines the following methods: get_doctest(string, globs, name, filename, lineno) Extract all doctest examples from the given string, and collect them into a DocTest object. globs, name, filename, and lineno are attributes for the new DocTest object. See the documentation for DocTest for more information. get_examples(string, name=''

doctest.DocTestFinder.find()

find(obj[, name][, module][, globs][, extraglobs]) Return a list of the DocTests that are defined by obj‘s docstring, or by any of its contained objects’ docstrings. The optional argument name specifies the object’s name; this name will be used to construct names for the returned DocTests. If name is not specified, then obj.__name__ is used. The optional parameter module is the module that contains the given object. If the module is not specified or is None, then the test finder will attempt

doctest.DocTestFinder

class doctest.DocTestFinder(verbose=False, parser=DocTestParser(), recurse=True, exclude_empty=True) A processing class used to extract the DocTests that are relevant to a given object, from its docstring and the docstrings of its contained objects. DocTests can be extracted from modules, classes, functions, methods, staticmethods, classmethods, and properties. The optional argument verbose can be used to display the objects searched by the finder. It defaults to False (no output). The optio

doctest.DocTestFailure.test

DocTestFailure.test The DocTest object that was being run when the example failed.

doctest.DocTestFailure.got

DocTestFailure.got The example’s actual output.

doctest.DocTestFailure.example

DocTestFailure.example The Example that failed.

doctest.DocTestFailure

exception doctest.DocTestFailure(test, example, got) An exception raised by DocTestRunner to signal that a doctest example’s actual output did not match its expected output. The constructor arguments are used to initialize the attributes of the same names.

doctest.DocTest.name

name A string name identifying the DocTest. Typically, this is the name of the object or file that the test was extracted from.

doctest.DocTest.lineno

lineno The line number within filename where this DocTest begins, or None if the line number is unavailable. This line number is zero-based with respect to the beginning of the file.