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-15.00:23:01
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1344990182.91.0.720492591435.issue14649@psf.upfronthosting.co.za>
In-reply-to
Content
The problem seems to be restricted only to DocTestSuite.  testmod and DocTestFinder both seem to work fine.  DocTestSuite calls DocTestFinder but not the other way around: nothing calls DocTestSuite.

If in certain versions we do not treat raising the exception as a bug (e.g. in already-released versions), then I am hoping we can at least document the behavior as a known issue in those versions and still change the exception message to be more accurate and helpful.

Aside from ensuring that docstrings are present, another way to work around the issue is to pass a DocTestFinder to DocTestSuite with exclude_empty set to False, as in the following code:

finder = DocTestFinder(exclude_empty=False)
suite = DocTestSuite(module, test_finder=finder)

Depending on what we decide for which versions, I am willing to create two patches: one for the documentation and exception message change (e.g. for stable versions), and another to drop raising the exception (e.g. for future versions).
History
Date User Action Args
2012-08-15 00:23:03chris.jerdoneksetrecipients: + chris.jerdonek, r.david.murray, asvetlov
2012-08-15 00:23:02chris.jerdoneksetmessageid: <1344990182.91.0.720492591435.issue14649@psf.upfronthosting.co.za>
2012-08-15 00:23:02chris.jerdoneklinkissue14649 messages
2012-08-15 00:23:01chris.jerdonekcreate