In my test code, my doctest failed, but the script exits with a null return value, which causes the CI to pass, which is not intended.
Is this the correct behavior of the doctest module?
My script ends with:
if __name__ == '__main__': import doctest doctest.testmod()
The output looks like this:
********************************************************************** File "test/test.py", line 7, in __main__ Failed example: f(1,0) Expected: ----- type: <type 'exceptions.ZeroDivisionError'> value: integer division or modulo by zero x ----- Got: ----- type: <type 'exceptions.ZeroDivisionError'> value: integer division or modulo by zero ----- ********************************************************************** 1 items had failures: 1 of 1 in __main__ ***Test Failed*** 1 failures. tux@iPad :~/programming/exception-notifier(fix-travis)(0)$ echo $? 0
source share