This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author r.david.murray
Recipients asvetlov, chris.jerdonek, r.david.murray
Date 2012-08-14.17:17:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1344964664.91.0.456613261791.issue14649@psf.upfronthosting.co.za>
In-reply-to
Content
Chris isn't suggesting changing the behavior, just the error message.  I agree with his change for exactly the reason you say: currently doctest doesn't complain if a module does have docstrings but none of those docstrings are tests.  So a module could have no tests without the error being raised.

However, I suspect that the current behavior is a bug.  I suspect the intent was to raise an error if there were no *tests*, not if there were no docstrings.  I don't think it is a bug that should be fixed, though.  I have a couple of test runners in various projects that run doctest on *all* modules, the goal being to pick up any doctests that there are or that I may add, even though not all modules have docstrings that contain doctests.  The doctest version of TestCase-based discovery.

So if anything I think this exception should be dropped.  If the report is that no tests are run, that should be enough of an indication that something is wrong, without raising an error, as it has been for the case where there are docstrings but no tests (we do not as far as I know have a bug or feature request that the current behavior is inadequate).
History
Date User Action Args
2012-08-14 17:17:44r.david.murraysetrecipients: + r.david.murray, asvetlov, chris.jerdonek
2012-08-14 17:17:44r.david.murraysetmessageid: <1344964664.91.0.456613261791.issue14649@psf.upfronthosting.co.za>
2012-08-14 17:17:44r.david.murraylinkissue14649 messages
2012-08-14 17:17:43r.david.murraycreate