Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5d2f515

Browse files
committed
fix markup nits
1 parent c0fac96 commit 5d2f515

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

Doc/lib/libdoctest.tex

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ \subsection{Normal Usage}
153153
\end{verbatim}
154154

155155
If you want to test the module as the main module, you don't need to
156-
pass M to \function{testmod}; in this case, it will test the current
156+
pass M to \function{testmod()}; in this case, it will test the current
157157
module.
158158

159159
Then running the module as a script causes the examples in the docstrings
@@ -176,11 +176,12 @@ \subsection{Normal Usage}
176176
and a detailed report of all examples tried is printed to \code{stdout},
177177
along with assorted summaries at the end.
178178

179-
You can force verbose mode by passing \code{verbose=1} to testmod, or
179+
You can force verbose mode by passing \code{verbose=1} to
180+
\function{testmod()}, or
180181
prohibit it by passing \code{verbose=0}. In either of those cases,
181-
\code{sys.argv} is not examined by testmod.
182+
\code{sys.argv} is not examined by \function{testmod()}.
182183

183-
In any case, testmod returns a 2-tuple of ints \code{(\var{f},
184+
In any case, \function{testmod()} returns a 2-tuple of ints \code{(\var{f},
184185
\var{t})}, where \var{f} is the number of docstring examples that
185186
failed and \var{t} is the total number of docstring examples
186187
attempted.
@@ -210,8 +211,8 @@ \subsection{Which Docstrings Are Examined?}
210211

211212
\subsection{What's the Execution Context?}
212213

213-
By default, each time testmod finds a docstring to test, it uses a
214-
\emph{copy} of \module{M}'s globals, so that running tests on a module
214+
By default, each time \function{testmod()} finds a docstring to test, it uses
215+
a \emph{copy} of \module{M}'s globals, so that running tests on a module
215216
doesn't change the module's real globals, and so that one test in
216217
\module{M} can't leave behind crumbs that accidentally allow another test
217218
to work. This means examples can freely use any names defined at top-level
@@ -400,21 +401,20 @@ \subsection{Warnings}
400401
\end{verbatim}
401402

402403
\item WYSIWYG isn't always the case, starting in Python 2.3. The
403-
string form of boolean results changed from \code{"0"} and
404-
\code{"1"} to \code{"False"} and \code{"True"} in Python 2.3.
404+
string form of boolean results changed from \code{'0'} and
405+
\code{'1'} to \code{'False'} and \code{'True'} in Python 2.3.
405406
This makes it clumsy to write a doctest showing boolean results that
406407
passes under multiple versions of Python. In Python 2.3, by default,
407408
and as a special case, if an expected output block consists solely
408-
of \code{"0"} and the actual output block consists solely of
409-
\code{"False"}, that's accepted as an exact match, and similarly for
410-
\code{"1"} versus \code{"True"}. This behavior can be turned off by
409+
of \code{'0'} and the actual output block consists solely of
410+
\code{'False'}, that's accepted as an exact match, and similarly for
411+
\code{'1'} versus \code{'True'}. This behavior can be turned off by
411412
passing the new (in 2.3) module constant
412413
\constant{DONT_ACCEPT_TRUE_FOR_1} as the value of \function{testmod()}'s
413414
new (in 2.3) optional \var{optionflags} argument. Some years after
414415
the integer spellings of booleans are history, this hack will
415416
probably be removed again.
416417

417-
418418
\end{enumerate}
419419

420420

0 commit comments

Comments
 (0)