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 chris.jerdonek
Recipients asvetlov, chris.jerdonek, r.david.murray
Date 2012-08-14.19:12:56
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1344971576.91.0.494710545775.issue14649@psf.upfronthosting.co.za>
In-reply-to
Content
> I suspect the intent was to raise an error if there were no *tests*, not if there were no docstrings.

That, or the implementor thought that if no docstrings were found, then that might indicate something went wrong with the parsing.

For background purposes, here is the justification in the code comment:

    elif not tests:
        # Why do we want to do this? Because it reveals a bug that might
        # otherwise be hidden.
        raise ValueError(module, "has no tests")

> I have a couple of test runners in various projects that run doctest on *all* modules

Same here, which is how I noticed the issue.

> 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

I would be in favor of this. The unittest module's test discovery, for example, does not raise an exception if it finds no tests (to my knowledge).  In what versions would we be able to make this change?

I could prepare another patch.
History
Date User Action Args
2012-08-14 19:12:56chris.jerdoneksetrecipients: + chris.jerdonek, r.david.murray, asvetlov
2012-08-14 19:12:56chris.jerdoneksetmessageid: <1344971576.91.0.494710545775.issue14649@psf.upfronthosting.co.za>
2012-08-14 19:12:56chris.jerdoneklinkissue14649 messages
2012-08-14 19:12:56chris.jerdonekcreate