Automatically run doctest every time program is run
Make it a habit to run pyflakes and the pep8 tools on Python projects. pep8 finds some style violations in this code:


There should be two blank lines before global method declarations (main and _doctests_pass in your case)
There shouldn't be trailing whitespace at the end of line 3 and 4.


You can install pyflakes and pep8 using pip. See also the PEP8 documentation for more details on Python style.

By the way, I think running unit tests is a job for a Continuous Integration system, not something to do every time you run the code. The point of testing is to run after every code change. You're going way further, but it's completely pointless. If the code hasn't changed, then the repeated tests are just wasting CPU cycles. I think it would be better to abandon this approach and leave this up to a Continuous Integration tool, where you could include other goodies easily like pep8, pyflakes, and others.

If this is not a team project, then setting up a Continuous Integration system could be overkill. A good middle ground can be setting up a pre-commit hook with your version control system. That should be relatively easy to do, and ensure that all your committed code pass your tests.