R. David Murray added the comment:
Rajiv is suggesting an improvement to the documentation. I think it is a
reasonable thought, but probably not a good idea on closer examination. The
example introduces the basic doctest concepts, and goes on to say that this is
not the mostly likely way to
Berker Peksag added the comment:
Hi Rajiv, thanks for the report, but this is already possible by default. I
will use the factorial example from
https://docs.python.org/3.5/library/doctest.html to demonstrate it:
$ python -m doctest example.py
$ echo $?
0
Now change the following
New submission from Rajiv Bakulesh Shah:
It might be nice if the doctest example set the appropriate exit status.
Apologies if this is beyond the scope of the example, but I thought it might be
good practice.
Here is the file:
https://github.com/python/cpython/blob/master/Doc/library/doctest.