astropy/astropy — pull request #746 by iguananaut (2013-03-09 01:16:43+00:00)
Title: Test doctests

It would really be pretty awesome if the continuous integration tests also ran all the doctests. This will of course take some work to set up, as we haven't generally run any of the doctests up 'til now. This should include any doctest-like examples in the docstrings, as well examples in the sphinx docs.

Naturally, some examples don't work well as doctests and can be skipped. doctest provides a few mechanisms for skipping specific tests.

It should also be noted that while playing with this I found a bug in py.test: If a property or other wrapped function contains a doctest in its docstring, and that test fails, it crashes py.test. I'm going to submit a bug report for this to py.test, and in the meantime we can either monkey-patch py.test, or just be aware of that issue. For what it's worth, I only found one such test in all of astropy which I've since fixed in a branch where I'm working on this.