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.rst Here is the example as written: if __name__ == "__main__": import doctest doctest.testmod() Here is my proposal: if __name__ == '__main__': import doctest import sys results = doctest.testmod() sys.exit(bool(results.failed)) I'm happy to fork the repo and submit a PR, if that makes things easier. I'm not familiar with the protocol here. Thanks for the great work! ---------- assignee: docs@python components: Documentation messages: 281015 nosy: Brainix, docs@python priority: normal severity: normal status: open title: doctest example exit status versions: Python 3.6 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue28722> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com