xdoctest1
Rewrite of python's builtin doctest module with ast instead of regex
Usage
xdoctest [-h]
[--version]
[-m
MODNAME]
[-c
COMMAND]
[--style
auto,google,freeform]
[--analysis
auto,static,dynamic]
[--durations
DURATIONS]
[--time]
[--colored
COLORED]
[--nocolor]
[--offset]
[--report
none,cdiff,ndiff,udiff,only_first_failure]
[--options
OPTIONS]
[--global-exec
GLOBAL_EXEC]
[--supress-import-errors]
[--verbose
VERBOSE]
[--quiet]
[--silent]
[arg ...]
Overview
The ``xdoctest`` package is a re-write of Python's builtin ``doctest`` module. It replaces the old regex-based parser with a new abstract-syntax-tree based parser (using Python's ``ast`` module). The goal is to make doctests easier to write, simpler to configure, and encourage the pattern of test driven development.
Options
-
-h, --help -
show this help message and exit
-
--version -
Display version info and quit (default: False) -m MODNAME, --modname MODNAME Module name or path. If specified positional modules are ignored (default: None) -c COMMAND, --command COMMAND A doctest name or a command (all|list|dump|<callname>). Defaults to `all` (which runs everything). Using `list` will collect and print all doctests. Using `dump` will convert doctests into unit tests. Anything else will be interpreted as a "callname" (default: None) --style {auto,google,freeform} Choose the style of doctests that will be parsed (default: auto) --analysis {auto,static,dynamic} How doctests are collected (default: auto) --durations DURATIONS Specify execution times for slowest N tests.N=0 will show times for all tests (default: None)
-
--time -
Same as if durations=0 (default: False)
-
--colored COLORED -
Enable or disable ANSI coloration in stdout (default: True)
-
--nocolor -
Disable ANSI coloration in stdout
-
--offset -
If True formatted source linenumbers will agree with their location in the source file. Otherwise they will be relative to the doctest itself. (default: False) --report {none,cdiff,ndiff,udiff,only_first_failure} Choose another output format for diffs on xdoctest failure (default: udiff)
-
--options OPTIONS -
Default directive flags for doctests (default: None) --global-exec GLOBAL_EXEC Custom Python code to execute before every test (default: None)
--supress-import-errorsRemoves tracebacks from errors in implicit imports (default: False)
-
--verbose VERBOSE -
Verbosity level. 0 is silent, 1 prints out test names, 2 additionally prints test stdout, 3 additionally prints test source (default: 3)
-
--quiet -
sets verbosity to 1
-
--silent -
sets verbosity to 0