[Python-checkins] python/dist/src/Doc/lib libdoctest.tex,1.9,1.10
loewis@users.sourceforge.net
loewis@users.sourceforge.net
Fri, 22 Nov 2002 00:23:11 -0800
Update of /cvsroot/python/python/dist/src/Doc/lib
In directory sc8-pr-cvs1:/tmp/cvs-serv10492/Doc/lib
Modified Files:
libdoctest.tex
Log Message:
Patch #486438: Make module argument to testmod optional.
Index: libdoctest.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libdoctest.tex,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** libdoctest.tex 2 Oct 2001 21:01:22 -0000 1.9
--- libdoctest.tex 22 Nov 2002 08:23:09 -0000 1.10
***************
*** 153,156 ****
--- 153,160 ----
\end{verbatim}
+ If you want to test the module as the main module, you don't need to
+ pass M to \function{testmod}; in this case, it will test the current
+ module.
+
Then running the module as a script causes the examples in the docstrings
to get executed and verified:
***************
*** 393,397 ****
def _test():
import doctest, sys
! doctest.testmod(sys.modules["__main__"])
\end{verbatim}
\end{enumerate}
--- 397,401 ----
def _test():
import doctest, sys
! doctest.testmod()
\end{verbatim}
\end{enumerate}