[Python-checkins] python/dist/src/Lib doctest.py,1.104,1.105

tim_one at users.sourceforge.net tim_one at users.sourceforge.net
Mon Sep 13 16:53:30 CEST 2004


Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1753/Lib

Modified Files:
	doctest.py 
Log Message:
exclude_empty:  make the default True for DocTestFinder, and introduce it
with default False for testmod().  The real point of introducing this was
so that output from doctest.master.summarize() would be the same as in
2.3, and doctest.master in 2.4 is a backward-compatability hack used only
by testmod().


Index: doctest.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/doctest.py,v
retrieving revision 1.104
retrieving revision 1.105
diff -u -d -r1.104 -r1.105
--- doctest.py	13 Sep 2004 05:47:24 -0000	1.104
+++ doctest.py	13 Sep 2004 14:53:27 -0000	1.105
@@ -848,8 +848,7 @@
     """
 
     def __init__(self, verbose=False, parser=DocTestParser(),
-                 recurse=True, _namefilter=None,
-                 exclude_empty=False):
+                 recurse=True, _namefilter=None, exclude_empty=True):
         """
         Create a new doctest finder.
 
@@ -862,8 +861,8 @@
         If the optional argument `recurse` is false, then `find` will
         only examine the given object, and not any contained objects.
 
-        If the optional argument `exclude_empty` is true, then `find`
-        will exclude tests for objects with empty docstrings.
+        If the optional argument `exclude_empty` is false, then `find`
+        will include tests for objects with empty docstrings.
         """
         self._parser = parser
         self._verbose = verbose
@@ -1836,9 +1835,10 @@
 
 def testmod(m=None, name=None, globs=None, verbose=None, isprivate=None,
             report=True, optionflags=0, extraglobs=None,
-            raise_on_error=False):
+            raise_on_error=False, exclude_empty=False):
     """m=None, name=None, globs=None, verbose=None, isprivate=None,
-       report=True, optionflags=0, extraglobs=None
+       report=True, optionflags=0, extraglobs=None, raise_on_error=False,
+       exclude_empty=False
 
     Test examples in docstrings in functions and classes reachable
     from module m (or the current module if m is not supplied), starting
@@ -1930,7 +1930,7 @@
         name = m.__name__
 
     # Find, parse, and run all tests in the given module.
-    finder = DocTestFinder(_namefilter=isprivate)
+    finder = DocTestFinder(_namefilter=isprivate, exclude_empty=exclude_empty)
 
     if raise_on_error:
         runner = DebugRunner(verbose=verbose, optionflags=optionflags)



More information about the Python-checkins mailing list