diff options
author | Tim Peters <tim.peters@gmail.com> | 2004-09-26 02:38:41 +0000 |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2004-09-26 02:38:41 +0000 |
commit | 16be62f054922b99853a05d30eea56d894984a4a (patch) | |
tree | 19722778672c3428c8c5db891b290ff289dbef2f | |
parent | 6a0a64b7adff64fe060bebe543796880cdea9148 (diff) | |
download | cpython-git-16be62f054922b99853a05d30eea56d894984a4a.tar.gz |
register_optionflag(): Moved from the Debugging section to the section
on option flags; added a versionadded decoration.
-rw-r--r-- | Doc/lib/libdoctest.tex | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/Doc/lib/libdoctest.tex b/Doc/lib/libdoctest.tex index 2a838dabd8..6ea4345d93 100644 --- a/Doc/lib/libdoctest.tex +++ b/Doc/lib/libdoctest.tex @@ -710,6 +710,25 @@ can be useful. matches an empty line in actual output; and doctest directives were added]{2.4} +There's also a way to register new option flag names, although this +isn't useful unless you intend to extend \module{doctest} internals +via subclassing: + +\begin{funcdesc}{register_optionflag}{name} + Create a new option flag with a given name, and return the new + flag's integer value. \function{register_optionflag()} can be + used when subclassing \class{OutputChecker} or + \class{DocTestRunner} to create new options that are supported by + your subclasses. \function{register_optionflag} should always be + called using the following idiom: + +\begin{verbatim} + MY_FLAG = register_optionflag('MY_FLAG') +\end{verbatim} + + \versionadded{2.4} +\end{funcdesc} + \subsubsection{Warnings\label{doctest-warnings}} \module{doctest} is serious about requiring exact matches in expected @@ -1620,18 +1639,6 @@ Doctest provides three mechanisms for debugging doctest examples: returned by \function{sys.exc_info()}. \end{memberdesc} -\begin{funcdesc}{register_optionflag}{name} - Create a new option flag with a given name, and return the new - flag's integer value. \function{register_optionflag()} can be - used when subclassing \class{OutputChecker} or - \class{DocTestRunner} to create new options that are supported by - your subclasses. \function{register_optionflag} should always be - called using the following idiom: -\begin{verbatim} - MY_FLAG = register_optionflag('MY_FLAG') -\end{verbatim} -\end{funcdesc} - \subsection{Soapbox\label{doctest-soapbox}} As mentioned in the introduction, \module{doctest} has grown to have |