Patch #486438: Make module argument to testmod optional.

This commit is contained in:
Martin v. Löwis 2002-11-22 08:23:09 +00:00
parent f86e8ef33e
commit 4581cfa326
3 changed files with 20 additions and 5 deletions

View file

@ -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}