Chris Jerdonek added the comment:

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).

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue14649>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to