R. David Murray added the comment:

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

----------

_______________________________________
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