xdoctest.exceptions module

Define errors that may be raised by xdoctest

exception xdoctest.exceptions.MalformedDocstr[source]

Bases: Exception

Exception raised when the docstring itself does not conform to the expected style (e.g. google / numpy).

exception xdoctest.exceptions.ExistingEventLoopError[source]

Bases: Exception

Exception raised when the docstring uses a top level await and the test is already running in an event loop.

exception xdoctest.exceptions.DoctestParseError(msg: str, string: str | None = None, info: Any | None = None, orig_ex: Exception | None = None)[source]

Bases: Exception

Exception raised when doctest code has an error.

Parameters:
  • msg (str) – error message

  • string (str | None) – the string that failed

  • info (Any | None) – extra information

  • orig_ex (Exception | None) – The underlying exceptoin

exception xdoctest.exceptions.ExitTestException[source]

Bases: Exception

exception xdoctest.exceptions.IncompleteParseError[source]

Bases: SyntaxError

Used when something goes wrong in the xdoctest parser

xdoctest.exceptions._resolve_skipped_exception_class() Any[source]
xdoctest.exceptions.Skipped

alias of LocalSkipped