[issue28722] doctest example exit status

Berker Peksag report at bugs.python.org
Wed Nov 23 11:37:11 EST 2016


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 line

    >>> [factorial(n) for n in range(6)]

to

    >>> [factorial(n) for n in range(5)]

and run the script again:

    $ python -m doctest example.py
    [...]
    ***Test Failed*** 1 failures.
    $ echo $?
    1

----------
nosy: +berker.peksag
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
type:  -> enhancement

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue28722>
_______________________________________


More information about the Python-bugs-list mailing list