summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2002-11-22 08:23:09 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2002-11-22 08:23:09 (GMT)
commit4581cfa326cf7d8b9d7888d4c0e96ee88950bcfa (patch)
tree1dafb4db99d1068c86f3470af1a2a2173315d273 /Doc
parentf86e8ef33ec22475a051b783b19ee22c5bd3de72 (diff)
downloadcpython-4581cfa326cf7d8b9d7888d4c0e96ee88950bcfa.zip
cpython-4581cfa326cf7d8b9d7888d4c0e96ee88950bcfa.tar.gz
cpython-4581cfa326cf7d8b9d7888d4c0e96ee88950bcfa.tar.bz2
Patch #486438: Make module argument to testmod optional.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/lib/libdoctest.tex6
1 files changed, 5 insertions, 1 deletions
diff --git a/Doc/lib/libdoctest.tex b/Doc/lib/libdoctest.tex
index edd78a4..9a795e9 100644
--- a/Doc/lib/libdoctest.tex
+++ b/Doc/lib/libdoctest.tex
@@ -152,6 +152,10 @@ if __name__ == "__main__":
_test()
\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:
@@ -392,7 +396,7 @@ definition of \function{_test()} is
\begin{verbatim}
def _test():
import doctest, sys
- doctest.testmod(sys.modules["__main__"])
+ doctest.testmod()
\end{verbatim}
\end{enumerate}