[New-bugs-announce] [issue14649] doctest.DocTestSuite error misleading when module has no docstrings

Chris Jerdonek report at bugs.python.org
Mon Apr 23 16:54:21 CEST 2012


New submission from Chris Jerdonek <chris.jerdonek at gmail.com>:

When invoking doctest.DocTestSuite's constructor with a module that has no docstrings, doctest raises the following exception:

...
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/doctest.py", line 2280, in DocTestSuite
    raise ValueError(module, "has no tests")
ValueError: (<module '[snip]' from '[snip]'>, 'has no tests')

The error message is misleading because the exception is not raised for modules that have docstrings but no doctests, only for modules that have no docstrings.

To be accurate, the message should be something like 'has no docstrings'.

----------
components: Library (Lib)
messages: 159022
nosy: cjerdonek
priority: normal
severity: normal
status: open
title: doctest.DocTestSuite error misleading when module has no docstrings
type: behavior
versions: Python 2.7, Python 3.2

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14649>
_______________________________________


More information about the New-bugs-announce mailing list