Chris Jerdonek added the comment:

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

----------

_______________________________________
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