Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Doctest for good module

python -m doctest src/examples/testing/good/mymath.py

In case of success there is no output.

However we can check the exit code which is 0 on success and some other number on failure.

Exit code on Linux and macOS:

$ echo $?
0

Exit code on Windows:

> echo %ERRORLEVEL%
0

We can also use the verbose mode to see the progress:

python -m doctest -v src/examples/testing/good/mymath.py