doctest.OutputChecker.check_output()

check_output(want, got, optionflags) Return True iff the actual output from an example (got) matches the expected output (want). These strings are always considered to match if they are identical; but depending on what option flags the test runner is using, several non-exact match types are also possible. See section Option Flags for more information about option flags.

doctest.register_optionflag()

doctest.register_optionflag(name) Create a new option flag with a given name, and return the new flag’s integer value. register_optionflag() can be used when subclassing OutputChecker or DocTestRunner to create new options that are supported by your subclasses. register_optionflag() should always be called using the following idiom: MY_FLAG = register_optionflag('MY_FLAG')

doctest.OutputChecker

class doctest.OutputChecker A class used to check the whether the actual output from a doctest example matches the expected output. OutputChecker defines two methods: check_output(), which compares a given pair of outputs, and returns true if they match; and output_difference(), which returns a string describing the differences between two outputs. OutputChecker defines the following methods: check_output(want, got, optionflags) Return True iff the actual output from an example (got) matc

doctest.OutputChecker.output_difference()

output_difference(example, got, optionflags) Return a string describing the differences between the expected output for a given example (example) and the actual output (got). optionflags is the set of option flags used to compare want and got.

doctest.Example.indent

indent The example’s indentation in the containing string, i.e., the number of space characters that precede the example’s first prompt.

doctest.Example.source

source A string containing the example’s source code. This source code consists of a single Python statement, and always ends with a newline; the constructor adds a newline when necessary.

doctest.Example.lineno

lineno The line number within the string containing this example where the example begins. This line number is zero-based with respect to the beginning of the containing string.

doctest.Example.options

options A dictionary mapping from option flags to True or False, which is used to override default options for this example. Any option flags not contained in this dictionary are left at their default value (as specified by the DocTestRunner‘s optionflags). By default, no options are set.

doctest.Example.exc_msg

exc_msg The exception message generated by the example, if the example is expected to generate an exception; or None if it is not expected to generate an exception. This exception message is compared against the return value of traceback.format_exception_only(). exc_msg ends with a newline unless it’s None. The constructor adds a newline if needed.

doctest.DocTestRunner.summarize()

summarize(verbose=None) Print a summary of all the test cases that have been run by this DocTestRunner, and return a named tuple TestResults(failed, attempted). The optional verbose argument controls how detailed the summary is. If the verbosity is not specified, then the DocTestRunner‘s verbosity is used.