June 2017
Beginner to intermediate
274 pages
6h 49m
English
To test the code example using doctest, we just need to run the following command:
$ python3 -m doctest example.py -v
We will get the following output:

Having doctest run all the examples in a file and report back whether they worked is easy. We just run the doctest utility from the command line and tell it which files we were interested in. The -v option in the command makes it pull out extra information, which isn't necessary, but often is helpful.
All we see in the preceding example is a lack of error messages rather than any confirmation that everything worked or is tested.
There are other ways of running ...
Read now
Unlock full access