On this page
doctest.DebugRunner
Prev: doctest.debug_src | Up: doctest | Next: doctest.DocFileSuite
Rel: doctest.debug, doctest.debug_src, doctest.DocFileSuite, doctest.DocTest
Ref: docs.python.org — doctest.DebugRunner
Tags: #public #python3 #stdlib #doctest
Import
import doctest
from doctest import DebugRunner
Signature & Overview
doctest.DebugRunner(checker=None, verbose=None, optionflags=0)
Run doc tests but raise an exception as soon as there is a failure.
Methods & Attributes
DebugRunner.merge(self, other)—DebugRunner.mergemethod/property.DebugRunner.report_failure(self, out, test, example, got)—DebugRunner.report_failuremethod/property.DebugRunner.report_start(self, out, test, example)— Report that the test runner is about to process the given example. (Only displays a message if verbose=True)DebugRunner.report_success(self, out, test, example, got)— Report that the given example ran successfully. (Only displays a message if verbose=True)DebugRunner.report_unexpected_exception(self, out, test, example, exc_info)—DebugRunner.report_unexpected_exceptionmethod/property.DebugRunner.run(self, test, compileflags=None, out=None, clear_globs=True)—DebugRunner.runmethod/property.DebugRunner.summarize(self, verbose=None)— Print a summary of all the test cases that have been run by this DocTestRunner, and return a TestResults instance.
Usage
import doctest
# Runner that stops immediately on the first doctest failure or unexpected exception
assert issubclass(doctest.DebugRunner, doctest.DocTestRunner)
Gotchas
- Raises
DocTestFailure/UnexpectedExceptioninstead of summarizing: Useful when stepping into failures withpdb.
REPL Inspect
from doctest import DebugRunner
help(DebugRunner)
Linked from
- tuts/python3/stdlib_module/doctest
- tuts/python3/stdlib_module/doctest/debug
- tuts/python3/stdlib_module/doctest/debug_src
- tuts/python3/stdlib_module/doctest/DocFileSuite
- tuts/python3/stdlib_module/doctest/DocTest
- tuts/python3/stdlib_module/doctest/DocTestFailure
- tuts/python3/stdlib_module/doctest/DocTestFinder
- tuts/python3/stdlib_module/doctest/DocTestParser
- tuts/python3/stdlib_module/doctest/DocTestRunner
- tuts/python3/stdlib_module/doctest/DocTestSuite
- tuts/python3/stdlib_module/doctest/Example
- tuts/python3/stdlib_module/doctest/OutputChecker
- tuts/python3/stdlib_module/doctest/register_optionflag
- tuts/python3/stdlib_module/doctest/run_docstring_examples
- tuts/python3/stdlib_module/doctest/script_from_examples
- tuts/python3/stdlib_module/doctest/set_unittest_reportflags
- tuts/python3/stdlib_module/doctest/testfile
- tuts/python3/stdlib_module/doctest/testmod
- tuts/python3/stdlib_module/doctest/testsource
- tuts/python3/stdlib_module/doctest/UnexpectedException
Related notes
- tuts/python3/stdlib_module/doctest/debug Linked here; links to this page; shared tags: #doctest, #stdlib
- tuts/python3/stdlib_module/doctest/debug_src Linked here; links to this page; shared tags: #doctest, #stdlib
- tuts/python3/stdlib_module/doctest/DocFileSuite Linked here; links to this page; shared tags: #doctest, #stdlib
- tuts/python3/stdlib_module/doctest/DocTest Linked here; links to this page; shared tags: #doctest, #stdlib
- tuts/python3/stdlib_module/doctest/DocTestFailure links to this page; shared tags: #doctest, #stdlib
- tuts/python3/stdlib_module/doctest/DocTestFinder links to this page; shared tags: #doctest, #stdlib
- tuts/python3/stdlib_module/doctest/DocTestParser links to this page; shared tags: #doctest, #stdlib
- tuts/python3/stdlib_module/doctest/DocTestRunner links to this page; shared tags: #doctest, #stdlib
- tuts/python3/stdlib_module/doctest/DocTestSuite links to this page; shared tags: #doctest, #stdlib
- tuts/python3/stdlib_module/doctest/Example links to this page; shared tags: #doctest, #stdlib