| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
| 2 | <html> |
| 3 | <head> |
| 4 | <link rel="STYLESHEET" href="lib.css" type='text/css' /> |
| 5 | <link rel="SHORTCUT ICON" href="../icons/pyfav.png" type="image/png" /> |
| 6 | <link rel='start' href='../index.html' title='Python Documentation Index' /> |
| 7 | <link rel="first" href="lib.html" title='Python Library Reference' /> |
| 8 | <link rel='contents' href='contents.html' title="Contents" /> |
| 9 | <link rel='index' href='genindex.html' title='Index' /> |
| 10 | <link rel='last' href='about.html' title='About this document...' /> |
| 11 | <link rel='help' href='about.html' title='About this document...' /> |
| 12 | <link rel="next" href="doctest-basic-api.html" /> |
| 13 | <link rel="prev" href="doctest-simple-testfile.html" /> |
| 14 | <link rel="parent" href="module-doctest.html" /> |
| 15 | <link rel="next" href="doctest-which-docstrings.html" /> |
| 16 | <meta name='aesop' content='information' /> |
| 17 | <title>5.2.3 How It Works</title> |
| 18 | </head> |
| 19 | <body> |
| 20 | <DIV CLASS="navigation"> |
| 21 | <div id='top-navigation-panel' xml:id='top-navigation-panel'> |
| 22 | <table align="center" width="100%" cellpadding="0" cellspacing="2"> |
| 23 | <tr> |
| 24 | <td class='online-navigation'><a rel="prev" title="5.2.2 Simple Usage: Checking" |
| 25 | href="doctest-simple-testfile.html"><img src='../icons/previous.png' |
| 26 | border='0' height='32' alt='Previous Page' width='32' /></A></td> |
| 27 | <td class='online-navigation'><a rel="parent" title="5.2 doctest " |
| 28 | href="module-doctest.html"><img src='../icons/up.png' |
| 29 | border='0' height='32' alt='Up One Level' width='32' /></A></td> |
| 30 | <td class='online-navigation'><a rel="next" title="5.2.3.1 Which Docstrings Are" |
| 31 | href="doctest-which-docstrings.html"><img src='../icons/next.png' |
| 32 | border='0' height='32' alt='Next Page' width='32' /></A></td> |
| 33 | <td align="center" width="100%">Python Library Reference</td> |
| 34 | <td class='online-navigation'><a rel="contents" title="Table of Contents" |
| 35 | href="contents.html"><img src='../icons/contents.png' |
| 36 | border='0' height='32' alt='Contents' width='32' /></A></td> |
| 37 | <td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png' |
| 38 | border='0' height='32' alt='Module Index' width='32' /></a></td> |
| 39 | <td class='online-navigation'><a rel="index" title="Index" |
| 40 | href="genindex.html"><img src='../icons/index.png' |
| 41 | border='0' height='32' alt='Index' width='32' /></A></td> |
| 42 | </tr></table> |
| 43 | <div class='online-navigation'> |
| 44 | <b class="navlabel">Previous:</b> |
| 45 | <a class="sectref" rel="prev" href="doctest-simple-testfile.html">5.2.2 Simple Usage: Checking</A> |
| 46 | <b class="navlabel">Up:</b> |
| 47 | <a class="sectref" rel="parent" href="module-doctest.html">5.2 doctest </A> |
| 48 | <b class="navlabel">Next:</b> |
| 49 | <a class="sectref" rel="next" href="doctest-which-docstrings.html">5.2.3.1 Which Docstrings Are</A> |
| 50 | </div> |
| 51 | <hr /></div> |
| 52 | </DIV> |
| 53 | <!--End of Navigation Panel--> |
| 54 | |
| 55 | <H2><A NAME="SECTION007230000000000000000"></A><A NAME="doctest-how-it-works"></A> |
| 56 | <BR> |
| 57 | 5.2.3 How It Works |
| 58 | </H2> |
| 59 | |
| 60 | <P> |
| 61 | This section examines in detail how doctest works: which docstrings it |
| 62 | looks at, how it finds interactive examples, what execution context it |
| 63 | uses, how it handles exceptions, and how option flags can be used to |
| 64 | control its behavior. This is the information that you need to know |
| 65 | to write doctest examples; for information about actually running |
| 66 | doctest on these examples, see the following sections. |
| 67 | |
| 68 | <P> |
| 69 | |
| 70 | <p><br /></p><hr class='online-navigation' /> |
| 71 | <div class='online-navigation'> |
| 72 | <!--Table of Child-Links--> |
| 73 | <A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></a> |
| 74 | |
| 75 | <UL CLASS="ChildLinks"> |
| 76 | <LI><A href="doctest-which-docstrings.html">5.2.3.1 Which Docstrings Are Examined?</a> |
| 77 | <LI><A href="doctest-finding-examples.html">5.2.3.2 How are Docstring Examples |
| 78 | Recognized?</a> |
| 79 | <LI><A href="doctest-execution-context.html">5.2.3.3 What's the Execution Context?</a> |
| 80 | <LI><A href="doctest-exceptions.html">5.2.3.4 What About Exceptions?</a> |
| 81 | <LI><A href="doctest-options.html">5.2.3.5 Option Flags and Directives</a> |
| 82 | <LI><A href="doctest-warnings.html">5.2.3.6 Warnings</a> |
| 83 | </ul> |
| 84 | <!--End of Table of Child-Links--> |
| 85 | </div> |
| 86 | |
| 87 | <DIV CLASS="navigation"> |
| 88 | <div class='online-navigation'> |
| 89 | <p></p><hr /> |
| 90 | <table align="center" width="100%" cellpadding="0" cellspacing="2"> |
| 91 | <tr> |
| 92 | <td class='online-navigation'><a rel="prev" title="5.2.2 Simple Usage: Checking" |
| 93 | href="doctest-simple-testfile.html"><img src='../icons/previous.png' |
| 94 | border='0' height='32' alt='Previous Page' width='32' /></A></td> |
| 95 | <td class='online-navigation'><a rel="parent" title="5.2 doctest " |
| 96 | href="module-doctest.html"><img src='../icons/up.png' |
| 97 | border='0' height='32' alt='Up One Level' width='32' /></A></td> |
| 98 | <td class='online-navigation'><a rel="next" title="5.2.3.1 Which Docstrings Are" |
| 99 | href="doctest-which-docstrings.html"><img src='../icons/next.png' |
| 100 | border='0' height='32' alt='Next Page' width='32' /></A></td> |
| 101 | <td align="center" width="100%">Python Library Reference</td> |
| 102 | <td class='online-navigation'><a rel="contents" title="Table of Contents" |
| 103 | href="contents.html"><img src='../icons/contents.png' |
| 104 | border='0' height='32' alt='Contents' width='32' /></A></td> |
| 105 | <td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png' |
| 106 | border='0' height='32' alt='Module Index' width='32' /></a></td> |
| 107 | <td class='online-navigation'><a rel="index" title="Index" |
| 108 | href="genindex.html"><img src='../icons/index.png' |
| 109 | border='0' height='32' alt='Index' width='32' /></A></td> |
| 110 | </tr></table> |
| 111 | <div class='online-navigation'> |
| 112 | <b class="navlabel">Previous:</b> |
| 113 | <a class="sectref" rel="prev" href="doctest-simple-testfile.html">5.2.2 Simple Usage: Checking</A> |
| 114 | <b class="navlabel">Up:</b> |
| 115 | <a class="sectref" rel="parent" href="module-doctest.html">5.2 doctest </A> |
| 116 | <b class="navlabel">Next:</b> |
| 117 | <a class="sectref" rel="next" href="doctest-which-docstrings.html">5.2.3.1 Which Docstrings Are</A> |
| 118 | </div> |
| 119 | </div> |
| 120 | <hr /> |
| 121 | <span class="release-info">Release 2.4.2, documentation updated on 28 September 2005.</span> |
| 122 | </DIV> |
| 123 | <!--End of Navigation Panel--> |
| 124 | <ADDRESS> |
| 125 | See <i><a href="about.html">About this document...</a></i> for information on suggesting changes. |
| 126 | </ADDRESS> |
| 127 | </BODY> |
| 128 | </HTML> |