[Python-checkins] python/dist/src/Doc/lib libdoctest.tex,1.13,1.14

rhettinger@users.sourceforge.net rhettinger@users.sourceforge.net
Wed, 16 Jul 2003 12:25:24 -0700


Update of /cvsroot/python/python/dist/src/Doc/lib
In directory sc8-pr-cvs1:/tmp/cvs-serv32010/Doc/lib

Modified Files:
	libdoctest.tex 
Log Message:
Doctest now examines all docstrings by default.  Previously, it would
skip over functions with private names (as indicated by the underscore
naming convention).  The old default created too much of a risk that
user tests were being skipped inadvertently.  Note, this change could
break code in the unlikely case that someone had intentionally put
failing tests in the docstrings of private functions.  The breakage
is easily fixable by specifying the old behavior when calling testmod()
or Tester().  The more likely case is that the silent failure was 
unintended and that the user needed to be informed so the test could be
fixed.



Index: libdoctest.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libdoctest.tex,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** libdoctest.tex	11 Jul 2003 22:32:18 -0000	1.13
--- libdoctest.tex	16 Jul 2003 19:25:22 -0000	1.14
***************
*** 191,203 ****
  See \file{docstring.py} for all the details.  They're unsurprising:  the
  module docstring, and all function, class and method docstrings are
! searched, with the exception of docstrings attached to objects with private
! names.  Objects imported into the module are not searched.
  
  In addition, if \code{M.__test__} exists and "is true", it must be a
  dict, and each entry maps a (string) name to a function object, class
  object, or string.  Function and class object docstrings found from
! \code{M.__test__} are searched even if the name is private, and
! strings are searched directly as if they were docstrings.  In output,
! a key \code{K} in \code{M.__test__} appears with name
  
  \begin{verbatim}
--- 191,204 ----
  See \file{docstring.py} for all the details.  They're unsurprising:  the
  module docstring, and all function, class and method docstrings are
! searched.  Optionally, the tester can be directed to exclude
! docstrings attached to objects with private names.
! Objects imported into the module are not searched.
  
  In addition, if \code{M.__test__} exists and "is true", it must be a
  dict, and each entry maps a (string) name to a function object, class
  object, or string.  Function and class object docstrings found from
! \code{M.__test__} are searched even if the the tester has been
! directly to skip over private names in the rest of the module.
! In output, a key \code{K} in \code{M.__test__} appears with name
  
  \begin{verbatim}
***************
*** 207,211 ****
  Any classes found are recursively searched similarly, to test docstrings in
  their contained methods and nested classes.  While private names reached
! from \module{M}'s globals are skipped, all names reached from
  \code{M.__test__} are searched.
  
--- 208,212 ----
  Any classes found are recursively searched similarly, to test docstrings in
  their contained methods and nested classes.  While private names reached
! from \module{M}'s globals can be optionally skipped, all names reached from
  \code{M.__test__} are searched.