On this page
doctest.UnexpectedException
Prev: doctest.testsource | Up: doctest
Rel: doctest.debug, doctest.debug_src, doctest.DebugRunner, doctest.DocFileSuite
Ref: docs.python.org โ doctest.UnexpectedException
Tags: #public #python3 #stdlib #doctest
Import
import doctest
from doctest import UnexpectedException
Signature & Overview
doctest.UnexpectedException(test, example, exc_info)
A DocTest example has encountered an unexpected exception The exception instance has variables: - test: the DocTest object being run
Methods & Attributes
UnexpectedException.add_note(self, note, /)โ Add a note to the exceptionUnexpectedException.with_traceback(self, tb, /)โ Set self.traceback to tb and return self.
Usage
import doctest
assert issubclass(doctest.UnexpectedException, Exception)
Gotchas
- Raised by
DebugRunnerwhen a doctest example raises an unexpected exception.
REPL Inspect
from doctest import UnexpectedException
help(UnexpectedException)
Linked from
Related notes
- tuts/python3/stdlib_module/doctest/testsource Linked here; links to this page; shared tags: #doctest, #stdlib
- tuts/python3/stdlib_module/doctest/debug Linked here; shared tags: #doctest, #stdlib
- tuts/python3/stdlib_module/doctest/debug_src Linked here; shared tags: #doctest, #stdlib
- tuts/python3/stdlib_module/doctest/DebugRunner Linked here; shared tags: #doctest, #stdlib
- tuts/python3/stdlib_module/doctest/DocFileSuite Linked here; shared tags: #doctest, #stdlib
- tuts/python3/stdlib_module/doctest/DocTest Linked here; shared tags: #doctest, #stdlib
- tuts/python3/stdlib_module/doctest links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/doctest/DocTestFailure shared tags: #doctest, #stdlib
- tuts/python3/stdlib_module/doctest/DocTestFinder shared tags: #doctest, #stdlib
- tuts/python3/stdlib_module/doctest/DocTestParser shared tags: #doctest, #stdlib