I guess that's because doctest.test_file() doesn't raise errors if there are errors.
In https://docs.python.org/3/library/doctest.html#doctest.testfile, I see there is a raise_on_error argument, which default value is False. We may set raise_on_error to True.
Check https://travis-ci.org/zeekay/decorum/jobs/73677996#L154-L193 The build is passing, but it contains some broken doctests. The build should fail if doctests fail.
I guess that's because
doctest.test_file()
doesn't raise errors if there are errors. In https://docs.python.org/3/library/doctest.html#doctest.testfile, I see there is araise_on_error
argument, which default value isFalse
. We may setraise_on_error
to True.