diff options
| author | Benjamin Peterson <benjamin@python.org> | 2012-09-29 18:14:19 (GMT) |
|---|---|---|
| committer | Benjamin Peterson <benjamin@python.org> | 2012-09-29 18:14:19 (GMT) |
| commit | 14fb44e1bab9db128770f1d91d244916a669e7c3 (patch) | |
| tree | 278d9ccc8f819b05f8114c3154087c70b88ed69c /Lib/doctest.py | |
| parent | 1764c80925795b6f059e961c5a352c5ece5a7fff (diff) | |
| parent | 99a247fd01c1cd780c0c3ee1116657627f1ee744 (diff) | |
| download | cpython-14fb44e1bab9db128770f1d91d244916a669e7c3.zip cpython-14fb44e1bab9db128770f1d91d244916a669e7c3.tar.gz cpython-14fb44e1bab9db128770f1d91d244916a669e7c3.tar.bz2 | |
merge mostly from default
Diffstat (limited to 'Lib/doctest.py')
| -rw-r--r-- | Lib/doctest.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/doctest.py b/Lib/doctest.py index 620451f..3af05fb 100644 --- a/Lib/doctest.py +++ b/Lib/doctest.py @@ -2334,7 +2334,12 @@ def DocTestSuite(module=None, globs=None, extraglobs=None, test_finder=None, 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") + # It is probably a bug that this exception is not also raised if the + # number of doctest examples in tests is zero (i.e. if no doctest + # examples were found). However, we should probably not be raising + # an exception at all here, though it is too late to make this change + # for a maintenance release. See also issue #14649. + raise ValueError(module, "has no docstrings") tests.sort() suite = unittest.TestSuite() |
