Message168246
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). |
|
Date |
User |
Action |
Args |
2012-08-15 00:23:03 | chris.jerdonek | set | recipients:
+ chris.jerdonek, r.david.murray, asvetlov |
2012-08-15 00:23:02 | chris.jerdonek | set | messageid: <1344990182.91.0.720492591435.issue14649@psf.upfronthosting.co.za> |
2012-08-15 00:23:02 | chris.jerdonek | link | issue14649 messages |
2012-08-15 00:23:01 | chris.jerdonek | create | |
|