diff options
Diffstat (limited to 'Doc/library/doctest.rst')
-rw-r--r-- | Doc/library/doctest.rst | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Doc/library/doctest.rst b/Doc/library/doctest.rst index b6d1756..b07663c 100644 --- a/Doc/library/doctest.rst +++ b/Doc/library/doctest.rst @@ -1060,6 +1060,16 @@ from text files and modules with doctests: .. versionchanged:: 2.5 The parameter *encoding* was added. + .. note:: + Unlike :func:`testmod` and :class:`DocTestFinder`, this function raises + a :exc:`ValueError` if *module* contains no docstrings. You can prevent + this error by passing a :class:`DocTestFinder` instance as the + *test_finder* argument with its *exclude_empty* keyword argument set + to ``False``:: + + >>> finder = doctest.DocTestFinder(exclude_empty=False) + >>> suite = doctest.DocTestSuite(test_finder=finder) + .. function:: DocTestSuite([module][, globs][, extraglobs][, test_finder][, setUp][, tearDown][, checker]) |