\Tc!@syeWnek r!eZnXyeWnek rFdZnXdZdddddddd d d d d ddddddddddddddddddd d!d"g!Zd#d$lZd#d$lZd#d$lZd#d$l Z d#d$l Z d#d$l Z d#d$l Z d#d$l Z d#d$lZd#d$lZd#d$lZd#d$lZd#d$lZd#d%lmZmZmZmZmZejd&deed'iZd(ZedZedZedZ edZ!edZ"eeBe Be!Be"BZ#ed Z$ed Z%ed Z&ed Z'e$e%Be&Be'BZ(d)Z)d*Z*d+Z+d,Z,d-d.Z-d/d0Z.d1Z/d2efd3YZ0d4Z1d5Z2d6ej3fd7YZ4d8Z5dfd9YZ6dfd:YZ7dfd;YZ8dfd<YZ9dfd=YZ:dfd>YZ;de<fd?YZ=de<fd@YZ>de:fdAYZ?e@aAe@e@e@e@e@eBd'e@eCeCdB ZDeBe@e@e@e@eBd'e@eCe8dC ZEeCdDe@d'dEZFdfdFYZGd'aHdGZIdHejJfdIYZKe@e@e@e@dJZLdKeKfdLYZMeBe@e@e8dMZNdNZOdOZPdPZQeCe@dQZReCe@dRZSeCdSZTdTfdUYZUieUdT6dVdW6dXdY6dZd[6d\d]6d^d_6ZVd`ZWedakreWnd$S(bcCsttt||S(N(tziptrangetlen(tseq((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyt enumeratessreStructuredText entregister_optionflagtDONT_ACCEPT_TRUE_FOR_1tDONT_ACCEPT_BLANKLINEtNORMALIZE_WHITESPACEtELLIPSIStIGNORE_EXCEPTION_DETAILtCOMPARISON_FLAGSt REPORT_UDIFFt REPORT_CDIFFt REPORT_NDIFFtREPORT_ONLY_FIRST_FAILUREtREPORTING_FLAGSt is_privatetExampletDocTestt DocTestParsert DocTestFindert DocTestRunnert OutputCheckertDocTestFailuretUnexpectedExceptiont DebugRunnerttestmodttestfiletrun_docstring_examplestTestert DocTestSuitet DocFileSuitetset_unittest_reportflagstscript_from_examplest testsourcet debug_srctdebugiN(tStringIOtexecfiletexec_t func_codetim_functignoreicCsdtt>}|t|<|S(Ni(RtOPTIONFLAGS_BY_NAME(tnametflag((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyRs s s...cCsItjdtdd|d dkoH|d dkoE|dkn S(sprefix, base -> true iff name prefix + "." + base is "private". Prefix may be an empty string, and base does not contain a period. Prefix is ignored (although functions you write conforming to this protocol may make use of it). Return true iff base begins with an (at least one) underscore, but does not both begin and end with (at least) two underscores. >>> is_private("a.b", "my_func") False >>> is_private("____", "_my_func") True >>> is_private("someclass", "__init__") False >>> is_private("sometypo", "__init_") True >>> is_private("x.y.z", "_") True >>> is_private("_x.y.z", "__") False >>> is_private("", "") # senseless but consistent False sVis_private is deprecated; it wasn't useful; examine DocTestFinder.find() lists insteadt stackleveliit_t__i(twarningstwarntDeprecationWarning(tprefixtbase((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyRs  cCsUd}xHtjD]=}|j|d}|tt|kr||jO}qqW|S(s Return the compiler-flags associated with the future features that have been imported into the given namespace (globs). iN(t __future__tall_feature_namestgettNonetgetattrt compiler_flag(tglobstflagstfnametfeature((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyt_extract_future_flagss icCsutj|r|St|tr>t|ttdgS|dkretj tj |j dSt ddS(s Return the module specified by `module`. In particular: - If `module` is a module, then return module. - If `module` is a string, then import and return the module with that name. - If `module` is None, then return the calling module. The calling module is assumed to be the module of the stack frame at the given depth in the call stack. t*t__name__s"Expected a module, string, or NoneN( tinspecttismodulet isinstancet basestringt __import__tglobalstlocalsR:tsystmodulest _getframet f_globalst TypeError(tmoduletdepth((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyt_normalize_modules  icCstjd|d|S(s{ Add the given number of space characters to the beginning every non-blank line in `s`, and return the result. s (?m)^(?!$)t (tretsub(tstindent((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyt_indentscCs;t}|\}}}tj|||d||jS(sz Return a string containing a traceback message for the given exc_info tuple (as returned by sys.exc_info()). tfile(R&t tracebacktprint_exceptiontgetvalue(texc_infotexcouttexc_typetexc_valtexc_tb((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyt_exception_tracebacks t _SpoofOutcBseZdZddZRS(cCsNtj|}|r2|jd r2|d7}nt|drJ|`n|S(Ns t softspace(R&R\tendswiththasattrRd(tselftresult((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyR\s   cCs,tj||t|dr(|`ndS(NRd(R&ttruncateRfRd(Rgtsize((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyRisN(RCt __module__R\R:Ri(((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyRcs cCs/|jtdkr||kS|jt}t|dksFtdt|}}|d}|r|j|rt|}|d=qtSn|d}|r|j|r|t|8}|d=qtSn||krtSxC|D];}|j|||}|dkrtS|t|7}qWtS(s_ Essentially the only subtle case: >>> _ellipsis_match('aa...aa', 'aaa') False iii( tfindtELLIPSIS_MARKERtsplitRtAssertionErrort startswithtFalseRetTrue(twanttgottwststartpostendpostw((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyt_ellipsis_match"s2         cCs"|j}|rd|SdSdS(s)Return a commented form of the given lines# t#N(trstrip(tline((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyt _comment_lineSs t_OutputRedirectingPdbcBs eZdZdZdZRS(s A specialized version of the python debugger that redirects stdout to a given stream when interacting with the user. Stdout is *not* redirected when traced code is executed. cCs||_tjj|dS(N(t_OutputRedirectingPdb__outtpdbtPdbt__init__(Rgtout((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyRas cGs=tj}|jt_ztjj||SWd|t_XdS(N(RKtstdoutRRRttrace_dispatch(Rgtargst save_stdout((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyRes   (RCRkt__doc__RR(((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyR~[s cCstj|s"td|n|jdr@tdnt|drktjj|j d}nw|j dkrt t j dkrt j ddkrtjjt j dd}qtj}ntd|d tjj||jdS( NsExpected a module: %rt/s1Module-relative files may not have absolute pathst__file__it__main__ts+Can't resolve paths relative to the module s (it has no __file__)(RDRERORpt ValueErrorRftostpathRnRRCRRKtargvtcurdirtjoin(RPRtbasedir((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyt_module_relative_pathps(  cBs#eZdZdddddZRS(sn A single doctest example, consisting of source code and expected output. `Example` defines the following attributes: - source: A single Python statement, always ending with a newline. The constructor adds a newline if needed. - want: The expected output from running the source code (either from stdout, or a traceback in case of exception). `want` ends with a newline unless it's empty, in which case it's an empty string. The constructor adds a newline if needed. - exc_msg: The exception message generated by the example, if the example is expected to generate an exception; or `None` if it is not expected to generate an exception. This exception message is compared against the return value of `traceback.format_exception_only()`. `exc_msg` ends with a newline unless it's `None`. The constructor adds a newline if needed. - lineno: The line number within the DocTest string containing this Example where the Example begins. This line number is zero-based, with respect to the beginning of the DocTest. - indent: The example's indentation in the DocTest string. I.e., the number of space characters that preceed the example's first prompt. - options: A dictionary mapping from option flags to True or False, which is used to override default options for this example. Any option flags not contained in this dictionary are left at their default value (as specified by the DocTestRunner's optionflags). By default, no options are set. icCs|jds|d7}n|r?|jd r?|d7}n|dk rh|jd rh|d7}n||_||_||_||_|dkri}n||_||_dS(Ns (ReR:tsourceRstlinenoRWtoptionstexc_msg(RgRRsRRRWR((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyRs         N(RCRkRR:R(((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyRs" cBs)eZdZdZdZdZRS(se A collection of doctest examples that should be run in a single namespace. Each `DocTest` defines the following attributes: - examples: the list of examples. - globs: The namespace (aka globals) that the examples should be run in. - name: A name identifying the DocTest (typically, the name of the object whose docstring this DocTest was extracted from). - filename: The name of the file that this DocTest was extracted from, or `None` if the filename is unknown. - lineno: The line number within filename where this DocTest begins, or `None` if the line number is unavailable. This line number is zero-based, with respect to the beginning of the file. - docstring: The string that the examples were extracted from, or `None` if the string is unavailable. cCs\t|t std||_||_|j|_||_||_||_ dS(s Create a new DocTest containing the given examples. The DocTest's globals are initialized with a copy of `globs`. s8DocTest no longer accepts str; use DocTestParser insteadN( RFRGRotexamplest docstringtcopyR=R-tfilenameR(RgRR=R-RRR((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyRs     cCslt|jdkrd}n1t|jdkr<d}ndt|j}d|j|j|j|fS(Nis no examplesis 1 examples %d exampless(RRR-RR(RgR((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyt__repr__s  cCsVt|tsdSt|j|j|jt|f|j|j|jt|fS(Ni(RFRtcmpR-RRtid(Rgtother((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyt__cmp__s!(RCRkRRRR(((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyRs  cBseZdZejdejejBZejdejejBejBZ ejdj Z ddZ dZ ddZdZejd ejZd Zejd ejZd Zd ZdZRS(sD A class used to parse strings containing doctest examples. s # Source consists of a PS1 line followed by zero or more PS2 lines. (?P (?:^(?P [ ]*) >>> .*) # PS1 line (?:\n [ ]* \.\.\. .*)*) # PS2 lines \n? # Want consists of any non-blank lines that do not start with PS1. (?P (?:(?![ ]*$) # Not a blank line (?![ ]*>>>) # Not a line starting with PS1 .*$\n? # But any other line )*) s # Grab the traceback header. Different versions of Python have # said different things on the first traceback line. ^(?P Traceback\ \( (?: most\ recent\ call\ last | innermost\ last ) \) : ) \s* $ # toss trailing whitespace on the header. (?P .*?) # don't blink: absorb stuff until... ^ (?P \w+ .*) # a line *starts* with alphanum. s ^[ ]*(#.*)?$sc Csx|j}|j|}|dkrYdjg|jdD]}||^q=}ng}d\}}x|jj|D]}|j|||j!||jd||j7}|j |||\} } } } |j | s.|jt | | | d|d|t |j dd| n||jd|j|j7}|j}q~W|j|||S(s= Divide the given string into examples and intervening text, and return them as a list of alternating Examples and strings. Line numbers for the Examples are 0-based. The optional argument `name` is a name identifying this string, and is only used for error messages. is RRWR(ii(t expandtabst _min_indentRRnt _EXAMPLE_REtfinditertappendtstarttcountt_parse_examplet_IS_BLANK_OR_COMMENTRRtgrouptend( RgtstringR-t min_indenttltoutputtcharnoRtmRRRsR((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pytparse5s&  2 ! %cCs%t|j|||||||S(s" Extract all doctest examples from the given string, and collect them into a `DocTest` object. `globs`, `name`, `filename`, and `lineno` are attributes for the new `DocTest` object. See the documentation for `DocTest` for more information. (Rt get_examples(RgRR=R-RR((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyt get_doctest\s cCs2g|j||D]}t|tr|^qS(s Extract all doctest examples from the given string, and return them as a list of `Example` objects. Line numbers are 0-based, because it's most common in doctests that nothing interesting appears on the same line as opening triple-quote, and so the first interesting line is called "line 1" then. The optional argument `name` is a name identifying this string, and is only used for error messages. (RRFR(RgRR-tx((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyRhs c Cs~t|jd}|jdjd}|j|||||j|dd|d||djg|D]}||d^qr}|jd}|jd} t| dkrtjd | d r| d =n|j| d|||t|djg| D]} | |^q}|jj|}|rS|jd } nd } |j |||} || || fS( s Given a regular expression match from `_EXAMPLE_RE` (`m`), return a pair `(source, want)`, where `source` is the matched example's source code (with prompts and indentation stripped); and `want` is the example's expected output (with indentation stripped). `name` is the string's name, and `lineno` is the line number where the example starts; both are used for error messages. RWRs iRSt.iRss *$itmsgN( RRRnt_check_prompt_blankt _check_prefixRRTtmatcht _EXCEPTION_RER:t _find_options( RgRR-RRWt source_linestslRRst want_linestwlRR((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyRvs$ "*( &s#\s*doctest:\s*([^\n\'"]*)$c Csi}x|jj|D]}|jdjddj}xp|D]h}|ddksm|dtkrtd|d||fnt|d}|ddk|||jr>x|jj D]\} } |j | || r~qWnt| trt|| } nt| trtt|| } ntj | stj | st| trW|j || rWd|| f} |j|| | ||||qWqWWndS( sm Find tests for the given object and any contained objects, and add them to `tests`. sFinding tests in %sNis%s.%st__test__s5DocTestFinder.find: __test__ keys must be strings: %rs`DocTestFinder.find: __test__ values must be strings, functions, methods, classes, or modules: %rs%s.__test__.%s(RRt _get_testR:RRDRERRtitemsRRRRRR;RFRGRRtismethodt staticmethodt classmethodR*R( RgRRR-RPRR=tseenttesttvalnametval((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyR|sX   %c Cst|tr|}ncyC|jdkr3d}n'|j}t|tsZt|}nWnttfk rzd}nX|j||}|jr| rdS|dkrd}n2t |d|j }|ddkr|d }n|j j |||||S( ss Return a DocTest for the given object, if it defines a docstring; otherwise, return None. RRis.pycs.pyoiN(s.pycs.pyo( RFRGRR:tstrROtAttributeErrort _find_linenoRR;RCRR( RgRR-RPR=RRRR((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyRs(       cCsd}tj|rd}ntj|r|dkr=dStjdt|dd}x6t|D]%\}}|j|ri|}PqiqiWntj |rt |}ntj |rt |}ntj |r|j}ntj|r|j}ntj|r/t|ddd}n|dk r|dkrO|dStjd}x7t|t|D]}|j||rt|SqtWndS( s Return a line number of the given object's docstring. Note: this method assumes that the object has a docstring. is^\s*class\s*%s\bRCt-tco_firstlinenois(^|.*:)\s*\w*("|')N(R:RDRERRTRR;RRRR*RR)t istracebackttb_frametisframetf_codetiscodeRR(RgRRRtpatRR|((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyRs<         N(RCRkRRqRRrR:RRlRRRRR(((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyRs   N   E %cBseZdZddZddddZdZdZdZdZ d Z d Z d Z e jd Zdd ZddedZddZdZRS(s A class used to run DocTest test cases, and accumulate statistics. The `run` method is used to process a single DocTest case. It returns a tuple `(f, t)`, where `t` is the number of test cases tried, and `f` is the number of test cases that failed. >>> tests = DocTestFinder().find(_TestClass) >>> runner = DocTestRunner(verbose=False) >>> for test in tests: ... print runner.run(test) (0, 2) (0, 1) (0, 2) (0, 2) The `summarize` method prints a summary of all the test cases that have been run by the runner, and returns an aggregated `(f, t)` tuple: >>> runner.summarize(verbose=1) 4 items passed all tests: 2 tests in _TestClass 2 tests in _TestClass.__init__ 2 tests in _TestClass.get 1 tests in _TestClass.square 7 tests in 4 items. 7 passed and 0 failed. Test passed. (0, 7) The aggregated number of tried examples and failed examples is also available via the `tries` and `failures` attributes: >>> runner.tries 7 >>> runner.failures 0 The comparison between expected outputs and actual outputs is done by an `OutputChecker`. This comparison may be customized with a number of option flags; see the documentation for `testmod` for more information. If the option flags are insufficient, then the comparison may also be customized by passing a subclass of `OutputChecker` to the constructor. The test runner's display output can be controlled in two ways. First, an output function (`out) can be passed to `TestRunner.run`; this function will be called with strings that should be displayed. It defaults to `sys.stdout.write`. If capturing the output is not sufficient, then the display output can be also customized by subclassing DocTestRunner, and overriding the methods `report_start`, `report_success`, `report_unexpected_exception`, and `report_failure`. RBiFicCsv|p t|_|dkr0dtjk}n||_||_||_d|_d|_ i|_ t |_ dS(sc Create a new test runner. Optional keyword arg `checker` is the `OutputChecker` that should be used to compare the expected outputs and actual outputs of doctest examples. Optional keyword arg 'verbose' prints lots of stuff if true, only failures if false; by default, it's true iff '-v' is in sys.argv. Optional argument `optionflags` can be used to control how the test runner compares expected output to actual output, and how it displays failures. See the documentation for `testmod` for more information. s-viN( Rt_checkerR:RKRRt optionflagstoriginal_optionflagsttriestfailurest_name2ftRct_fakeout(RgtcheckerRR((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyRUs       cCs_|jr[|jr=|dt|jdt|jq[|dt|jdndS(s Report that the test runner is about to process the given example. (Only displays a message if verbose=True) sTrying: s Expecting: sExpecting nothing N(RRsRXR(RgRRtexample((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyt report_startys   (cCs|jr|dndS(st Report that the given example ran successfully. (Only displays a message if verbose=True) sok N(R(RgRRR Rt((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pytreport_successs cCs3||j|||jj|||jdS(s7 Report that the given example failed. N(t_failure_headerRtoutput_differenceR(RgRRR Rt((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pytreport_failurescCs.||j||dtt|dS(sO Report that the given example raised an unexpected exception. sException raised: N(RRXRb(RgRRR R]((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pytreport_unexpected_exceptionscCs|jg}|jrs|jdk rJ|jdk rJ|j|jd}nd}|jd|j||jfn!|jd|jd|jf|jd|j}|jt|dj|S(Nit?sFile "%s", line %s, in %ssLine %s, in %ssFailed example:s ( tDIVIDERRRR:RR-RRXR(RgRR RRR((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyRs   !  c Csd}}|j}td\}}} |jj} x1t|jD] \} } |jt@of|dk} ||_| jrxH| jjD]4\}}|r|j|O_q|j|M_qWn|d7}| s|j ||| nd|j | f}y<t t | j |d|d|j|jjd }Wn3tk rQn tj}|jjnX|jj}|jjd|}|d kr| | j||jr|}qntj}tj|d d}| s|t|7}n| jd kr| }n| | j||jr;|}ns|jt@rtjd| j}tjd|}|r|r| |j d|j d|jr|}qn||kr| sd|j!||| |qdqD||kr| s|j"||| |n|d7}qD|| krL| s?|j#||| |n|d7}qDt$sDt%d |fqDW||_|j&|||||fS( s Run the examples in `test`. Write the outcome of each example with one of the `DocTestRunner.report_*` methods, using the writer function `out`. `compileflags` is the set of compiler flags that should be used to execute examples. Return a tuple `(f, t)`, where `t` is the number of examples tried, and `f` is the number of examples that failed. The examples are run in the namespace `test.globs`. iiistsingleiis[^:]*:sunknown outcomeN('RRRt check_outputRRRRRR R-R(RRR=tdebuggert set_continueR:tKeyboardInterruptRKR]R R\RiRsRZtformat_exception_onlyRbRR RTRRR RRRqRot_DocTestRunner__record_outcome(RgRt compileflagsRRRRtSUCCESStFAILUREtBOOMtcheckt examplenumR tquiett optionflagRRt exceptionRttoutcomeR]Rtm1tm2((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyt__runs~                  '         cCs^|jj|jd\}}||||f|j|j<|j|7_|j|7_dS(s{ Record the fact that the given DocTest (`test`) generated `f` failures out of `t` tried examples. iN(ii(RR9R-RR(RgRtftttf2tt2((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyt__record_outcome(ss3[\w\.]+)\[(?P\d+)\]>$cCs|jj|}|rb|jd|jjkrb|jjt|jd}|jjt St |j j dkr|j ||S|j |SdS(NR-R i( t%_DocTestRunner__LINECACHE_FILENAME_RERRRR-RtintRt splitlinesRrR)tsave_linecache_getlinest co_argcount(RgRtmodule_globalsRR ((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyt__patched_linecache_getlines5s!cCs||_|dkr't|j}ntj}|dkrH|j}n|jt_tj }t ||_ |j j |j j t_ t j|_|jt _z|j|||SWd|t_|t_ |jt _|r|jjnXdS(sJ Run the examples in `test`, and display the results using the writer function `out`. The examples are run in the namespace `test.globs`. If `clear_globs` is true (the default), then this namespace will be cleared after the test runs, to help with garbage collection. If you would like to examine the namespace after the test completes, then use `clear_globs=False`. `compileflags` gives the set of flags that should be used by the Python compiler when running the examples. If not specified, then it will default to the set of future-import flags that apply to `globs`. The output of each example is checked using `DocTestRunner.check_output`, and the results are formatted by the `DocTestRunner.report_*` methods. N(RR:RAR=RKRtwriteR Rt set_traceR~RtresetRRR0t*_DocTestRunner__patched_linecache_getlinest_DocTestRunner__runtclear(RgRRRt clear_globsRtsave_set_trace((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pytrun?s(             c Cs&|dkr|j}ng}g}g}d}}x|jjD]}|\}\} } | | ksnt|| 7}|| 7}| dkr|j|qD| dkr|j|| fqD|j|qDW|rd|rt|dfGH|jx|D]} d| fGHqWn|rdt|dfGH|jx&|D]\} } d| | fGHq?Wqdn|r|jGHt|dfGH|jx/|D]$\} \} } d| | | fGHqWn|r|dt|jd fGH||d |d fGHn|rd |d fGHn|rdGHn||fS(s Print a summary of all the test cases that have been run by this DocTestRunner, and return a tuple `(f, t)`, where `f` is the total number of failed examples, and `t` is the total number of tried examples. The optional `verbose` argument controls how detailed the summary is. If the verbosity is not specified, then the DocTestRunner's verbosity is used. isitems had no tests:s sitems passed all tests:s %3d tests in %ssitems had failures:s %3d of %3d in %sstests insitems.s passed andsfailed.s***Test Failed***s failures.s Test passed.N( R:RRRRoRRtsortR( RgRtnoteststpassedtfailedttotaltttotalfRR-R(R)tthingR((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyt summarizexsR           cCs|j}xs|jjD]b\}\}}||krkd|dGH||\}}||}||}n||f||>> runner = DebugRunner(verbose=False) >>> test = DocTestParser().get_doctest('>>> raise KeyError\n42', ... {}, 'foo', 'foo.py', 0) >>> try: ... runner.run(test) ... except UnexpectedException, failure: ... pass >>> failure.test is test True >>> failure.example.want '42\n' >>> exc_info = failure.exc_info >>> raise exc_info[0], exc_info[1], exc_info[2] Traceback (most recent call last): ... KeyError We wrap the original exception to give the calling application access to the test and example information. If the output doesn't match, then a DocTestFailure is raised: >>> test = DocTestParser().get_doctest(''' ... >>> x = 1 ... >>> x ... 2 ... ''', {}, 'foo', 'foo.py', 0) >>> try: ... runner.run(test) ... except DocTestFailure, failure: ... pass DocTestFailure objects provide access to the test: >>> failure.test is test True As well as to the example: >>> failure.example.want '2\n' and the actual output: >>> failure.got '1\n' If a failure or error occurs, the globals are left intact: >>> del test.globs['__builtins__'] >>> test.globs {'x': 1} >>> test = DocTestParser().get_doctest(''' ... >>> x = 2 ... >>> raise KeyError ... ''', {}, 'foo', 'foo.py', 0) >>> runner.run(test) Traceback (most recent call last): ... UnexpectedException: >>> del test.globs['__builtins__'] >>> test.globs {'x': 2} But the globals are cleared if there is no error: >>> test = DocTestParser().get_doctest(''' ... >>> x = 2 ... ''', {}, 'foo', 'foo.py', 0) >>> runner.run(test) (0, 1) >>> test.globs {} cCs5tj||||t}|r1|jjn|S(N(RR<RqR=R9(RgRRRR:tr((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyR<scCst|||dS(N(R(RgRRR R]((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyRscCst|||dS(N(R(RgRRR Rt((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyRsN(RCRkRR:RrR<RR(((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyRgsY c Cs@|d k rtjdtn|d kr@tjjd}ntj|set d|fn|d kr}|j }nt d|d| } |rt d|d|} nt d|d|} x3| j||d|d |D]} | j| qW|r| jntd kr#| an tj| | j| jfS( s m=None, name=None, globs=None, verbose=None, isprivate=None, report=True, optionflags=0, extraglobs=None, raise_on_error=False, exclude_empty=False Test examples in docstrings in functions and classes reachable from module m (or the current module if m is not supplied), starting with m.__doc__. Unless isprivate is specified, private names are not skipped. Also test examples reachable from dict m.__test__ if it exists and is not None. m.__test__ maps names to functions, classes and strings; function and class docstrings are tested even if the name is private; strings are tested directly, as if they were docstrings. Return (#failures, #tests). See doctest.__doc__ for an overview. Optional keyword arg "name" gives the name of the module; by default use m.__name__. Optional keyword arg "globs" gives a dict to be used as the globals when executing examples; by default, use m.__dict__. A copy of this dict is actually used for each docstring, so that each docstring's examples start with a clean slate. Optional keyword arg "extraglobs" gives a dictionary that should be merged into the globals that are used to execute examples. By default, no extra globals are used. This is new in 2.4. Optional keyword arg "verbose" prints lots of stuff if true, prints only failures if false; by default, it's true iff "-v" is in sys.argv. Optional keyword arg "report" prints a summary at the end when true, else prints nothing at the end. In verbose mode, the summary is detailed, else very brief (in fact, empty if all tests passed). Optional keyword arg "optionflags" or's together module constants, and defaults to 0. This is new in 2.3. Possible values (see the docs for details): DONT_ACCEPT_TRUE_FOR_1 DONT_ACCEPT_BLANKLINE NORMALIZE_WHITESPACE ELLIPSIS IGNORE_EXCEPTION_DETAIL REPORT_UDIFF REPORT_CDIFF REPORT_NDIFF REPORT_ONLY_FIRST_FAILURE Optional keyword arg "raise_on_error" raises an exception on the first unexpected exception or failure. This allows failures to be post-mortem debugged. Deprecated in Python 2.4: Optional keyword arg "isprivate" specifies a function used to determine whether a name is private. The default function is treat all functions as public. Optionally, "isprivate" can be set to doctest.is_private to skip over functions marked as private using the underscore naming convention; see its docs for details. Advanced tomfoolery: testmod runs methods of a local instance of class doctest.Tester, then merges the results into (or creates) global Tester instance doctest.master. Methods of doctest.master can be called directly too, if you want to do something unusual. Passing report=0 to testmod is especially useful then, to delay displaying a summary. Invoke doctest.master.summarize(verbose) when you're done fiddling. sPthe isprivate argument is deprecated; examine DocTestFinder.find() lists insteadRstestmod: module required; %rRRRRR=RN(R:R2R3R4RKRLR9RDRERORCRRRRlR<RDtmasterRFRR( RR-R=Rt isprivatetreportRRtraise_on_errorRtfindertrunnerR((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyRs*K      %    c Cs`|r| rtdn|r@t|}t||}n|dkratjj|}n|dkrvi}n |j}|dk r|j|n| rt d|d|} nt d|d|} t |} | j } | j | j| |||d}| j||r.| jntdkrC| an tj| | j| jfS(s Test examples in the given file. Return (#failures, #tests). Optional keyword arg "module_relative" specifies how filenames should be interpreted: - If "module_relative" is True (the default), then "filename" specifies a module-relative path. By default, this path is relative to the calling module's directory; but if the "package" argument is specified, then it is relative to that package. To ensure os-independence, "filename" should use "/" characters to separate path segments, and should not be an absolute path (i.e., it may not begin with "/"). - If "module_relative" is False, then "filename" specifies an os-specific path. The path may be absolute or relative (to the current working directory). Optional keyword arg "name" gives the name of the test; by default use the file's basename. Optional keyword argument "package" is a Python package or the name of a Python package whose directory should be used as the base directory for a module relative filename. If no package is specified, then the calling module's directory is used as the base directory for module relative filenames. It is an error to specify "package" if "module_relative" is False. Optional keyword arg "globs" gives a dict to be used as the globals when executing examples; by default, use {}. A copy of this dict is actually used for each docstring, so that each docstring's examples start with a clean slate. Optional keyword arg "extraglobs" gives a dictionary that should be merged into the globals that are used to execute examples. By default, no extra globals are used. Optional keyword arg "verbose" prints lots of stuff if true, prints only failures if false; by default, it's true iff "-v" is in sys.argv. Optional keyword arg "report" prints a summary at the end when true, else prints nothing at the end. In verbose mode, the summary is detailed, else very brief (in fact, empty if all tests passed). Optional keyword arg "optionflags" or's together module constants, and defaults to 0. Possible values (see the docs for details): DONT_ACCEPT_TRUE_FOR_1 DONT_ACCEPT_BLANKLINE NORMALIZE_WHITESPACE ELLIPSIS IGNORE_EXCEPTION_DETAIL REPORT_UDIFF REPORT_CDIFF REPORT_NDIFF REPORT_ONLY_FIRST_FAILURE Optional keyword arg "raise_on_error" raises an exception on the first unexpected exception or failure. This allows failures to be post-mortem debugged. Optional keyword arg "parser" specifies a DocTestParser (or subclass) that should be used to extract tests from the files. Advanced tomfoolery: testmod runs methods of a local instance of class doctest.Tester, then merges the results into (or creates) global Tester instance doctest.master. Methods of doctest.master can be called directly too, if you want to do something unusual. Passing report=0 to testmod is especially useful then, to delay displaying a summary. Invoke doctest.master.summarize(verbose) when you're done fiddling. s8Package may only be specified for module-relative paths.RRiN(RRRRR:RRtbasenameRRRRtopentreadtcloseRR<RDRYRFRR(Rtmodule_relativeR-tpackageR=RR[RRR\RR^R(RVR((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyRKs4M               tNoNamec Csdtd|dt}td|d|}x3|j||d|D]}|j|d|qCWdS(sr Test examples in the given object's docstring (`f`), using `globs` as globals. Optional argument `name` is used in failure messages. If the optional argument `verbose` is true, then generate output even if there are no failures. `compileflags` gives the set of flags that should be used by the Python compiler when running the examples. If not specified, then it will default to the set of future-import flags that apply to `globs`. Optional keyword arg `optionflags` specifies options for the testing and output. See the documentation for `testmod` for more information. RRRR=RN(RRqRRlR<( R(R=RR-RRR]R^R((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyRscBsbeZddddddZdZdddZddZdZddZdZ RS( icCstjdtdd|dkr=|dkr=tdn|dk rotj| rotd|fn|dkr|j}n||_||_ ||_ ||_ t d||_ td|d||_dS( NsCclass Tester is deprecated; use class doctest.DocTestRunner insteadR/is*Tester.__init__: must specify mod or globss)Tester.__init__: mod must be a module; %rRRR(R2R3R4R:RORDRERR=RRZRRt testfinderRt testrunner(RgtmodR=RRZR((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyRs          cCsztj||j|dd}|jr8d|fGHn|jj|\}}|jrp|d|d|fGHn||fS(NsRunning stringtofsexamples failed in string(RRR=R:RRgR<(RgRVR-RR(R)((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyt runstrings!  c Csvd}}|jj||d|d|j}x;|D]3}|jj|\}} |||| }}q5W||fS(NiRPR=(RfRlR=RgR<( RgRR-RPR(R)RRR*R+((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pytrundocs   cCsSddl}|j|}|jj||dkr@t}n|j|||S(Ni(ttypest ModuleTypeRRR:RqRk(RgRER-RPRlR((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pytrundict s    cCs4ddl}|j|}||_|j||S(Ni(RlRmRRk(RgRER-RlR((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyt run__test__s  cCs|jj|S(N(RgRD(RgR((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyRDscCs|jj|jdS(N(RgRF(RgR((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyRFsN( RCRkR:RRjRkRnRoRDRF(((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyRs     cCs2|t@|kr"td|nt}|a|S(sSets the unittest option flags. The old flag is returned so that a runner could restore the old value if it wished to: >>> old = _unittest_reportflags >>> set_unittest_reportflags(REPORT_NDIFF | ... REPORT_ONLY_FIRST_FAILURE) == old True >>> import doctest >>> doctest._unittest_reportflags == (REPORT_NDIFF | ... REPORT_ONLY_FIRST_FAILURE) True Only reporting flags can be set: >>> set_unittest_reportflags(ELLIPSIS) Traceback (most recent call last): ... ValueError: ('Only reporting flags allowed', 8) >>> set_unittest_reportflags(old) == (REPORT_NDIFF | ... REPORT_ONLY_FIRST_FAILURE) True sOnly reporting flags allowed(RRt_unittest_reportflags(R>told((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyR!#s t DocTestCasecBskeZdd d d dZdZdZdZdZdZdZ dZ e Z d Z RS( icCsAtjj|||_||_||_||_||_dS(N(tunittesttTestCaseRt_dt_optionflagst _dt_checkert_dt_testt _dt_setUpt _dt_tearDown(RgRRtsetUpttearDownR ((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyRIs     cCs,|j}|jdk r(|j|ndS(N(RwRxR:(RgR((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyRzSs cCs9|j}|jdk r(|j|n|jjdS(N(RwRyR:R=R9(RgR((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyR{Ys cCs|j}tj}t}|j}|t@s;|tO}ntd|d|jdt }z5dd|_ |j |d|j dt \}}Wd|t_X|r|j |j|jndS(NRR RRiFRR:(RwRKRR&RuRRpRRvRqRR<R4tfailureExceptiontformat_failureR\(RgRRqtnewRR^RR((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pytrunTestas        " cCsj|j}|jdkr!d}n d|j}dj|jjdd}d|j|j|||fS(Nsunknown line numbers%sRis:Failed doctest test for %s File "%s", line %s, in %s %s(RwRR:RR-RnR(RgterrRRtlname((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyR}ys   cCsI|jtd|jd|jdt}|j|j|jdS(sRun the test case without results and without catching exceptions The unit test framework includes a debug method on test cases and test suites to support post-mortem debugging. The test code is run in such a way that errors are not caught. This way a caller can catch the errors and initiate post-mortem debugging. The DocTestCase provides a debug method that raises UnexpectedException errors if there is an unexepcted exception: >>> test = DocTestParser().get_doctest('>>> raise KeyError\n42', ... {}, 'foo', 'foo.py', 0) >>> case = DocTestCase(test) >>> try: ... case.debug() ... except UnexpectedException, failure: ... pass The UnexpectedException contains the test, the example, and the original exception: >>> failure.test is test True >>> failure.example.want '42\n' >>> exc_info = failure.exc_info >>> raise exc_info[0], exc_info[1], exc_info[2] Traceback (most recent call last): ... KeyError If the output doesn't match, then a DocTestFailure is raised: >>> test = DocTestParser().get_doctest(''' ... >>> x = 1 ... >>> x ... 2 ... ''', {}, 'foo', 'foo.py', 0) >>> case = DocTestCase(test) >>> try: ... case.debug() ... except DocTestFailure, failure: ... pass DocTestFailure objects provide access to the test: >>> failure.test is test True As well as to the example: >>> failure.example.want '2\n' and the actual output: >>> failure.got '1\n' RR RN(RzRRuRvRqR<RwR{(RgR^((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyR%s B cCs |jjS(N(RwR-(Rg((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyRscCs4|jjjd}d|ddj|d fS(NRs%s (%s)i(RwR-RnR(RgR-((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyRscCsd|jjS(Ns Doctest: (RwR-(Rg((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pytshortDescriptionsN( RCRkR:RRzR{RR}R%RRRWR(((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyRrGs     H  c Ks|d krt}nt|}|j|d|d|}|d krW|j}n|sot|dn|jtj}xz|D]r}t |j dkrqn|j s|j }|dd kr|d }n||_ n|j t||qW|S( s Convert doctest tests for a module to a unittest test suite. This converts each documentation string in a module that contains doctest tests to a unittest test case. If any of the tests in a doc string fail, then the test case fails. An exception is raised showing the name of the file containing the test and a (sometimes approximate) line number. The `module` argument provides the module to be tested. The argument can be either a module or a module name. If no argument is given, the calling module is used. A number of options may be provided as keyword arguments: setUp A set-up function. This is called before running the tests in each file. The setUp function will be passed a DocTest object. The setUp function can access the test globals as the globs attribute of the test passed. tearDown A tear-down function. This is called after running the tests in each file. The tearDown function will be passed a DocTest object. The tearDown function can access the test globals as the globs attribute of the test passed. globs A dictionary containing initial global variables for the tests. optionflags A set of doctest option flags expressed as an integer. R=Rs has no testsiis.pycs.pyoiN(s.pycs.pyo(R:RRRRlRRR=Rst TestSuiteRRRRtaddTestRr( RPR=Rt test_finderRRtsuiteRR((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyRs(%            t DocFileCasecBs)eZdZdZeZdZRS(cCsdj|jjjdS(NR0R(RRwR-Rn(Rg((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyR scCs |jjS(N(RwR(Rg((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyR scCsd|jj|jj|fS(Ns2Failed doctest test for %s File "%s", line 0 %s(RwR-R(RgR((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyR}! s(RCRkRRRWR}(((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyR s  c Ks|dkri}n|r1| r1tdn|rUt|}t||}ntjj|}t|}|j}|j |j ||||d} t | |S(Ns8Package may only be specified for module-relative paths.i( R:RRRRRRR_R`RaRbRR( RRcRdR=RRR-R(tdocR((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyt DocFileTest& s       cOsetj}|jdtr:t|jd|dA unittest suite for one or more doctest files. The path to each doctest file is given as a string; the interpretation of that string depends on the keyword argument "module_relative". A number of options may be provided as keyword arguments: module_relative If "module_relative" is True, then the given file paths are interpreted as os-independent module-relative paths. By default, these paths are relative to the calling module's directory; but if the "package" argument is specified, then they are relative to that package. To ensure os-independence, "filename" should use "/" characters to separate path segments, and may not be an absolute path (i.e., it may not begin with "/"). If "module_relative" is False, then the given file paths are interpreted as os-specific paths. These paths may be absolute or relative (to the current working directory). package A Python package or the name of a Python package whose directory should be used as the base directory for module relative paths. If "package" is not specified, then the calling module's directory is used as the base directory for module relative filenames. It is an error to specify "package" if "module_relative" is False. setUp A set-up function. This is called before running the tests in each file. The setUp function will be passed a DocTest object. The setUp function can access the test globals as the globs attribute of the test passed. tearDown A tear-down function. This is called after running the tests in each file. The tearDown function will be passed a DocTest object. The tearDown function can access the test globals as the globs attribute of the test passed. globs A dictionary containing initial global variables for the tests. optionflags A set of doctest option flags expressed as an integer. parser A DocTestParser (or subclass) that should be used to extract tests from the files. RcRd(RsRR9RrRRRR(tpathstkwRR((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyR > s 5  cCs$g}xtj|D]}t|tr|j|jd |j}|r|jd|g|jdd D]}d|^qu7}qq|g|jdd D]}t|^q7}qWx$|r|ddkr|j qWx'|r|ddkr|j dqWdj |S(scExtract script from text with examples. Converts text with examples to a Python script. Example input is converted to regular code. Example output and all other words are converted to comments: >>> text = ''' ... Here are examples of simple math. ... ... Python has super accurate integer addition ... ... >>> 2 + 2 ... 5 ... ... And very friendly error messages: ... ... >>> 1/0 ... To Infinity ... And ... Beyond ... ... You can use logic if you want: ... ... >>> if 0: ... ... blah ... ... blah ... ... ... ... Ho hum ... ''' >>> print script_from_examples(text) # Here are examples of simple math. # # Python has super accurate integer addition # 2 + 2 # Expected: ## 5 # # And very friendly error messages: # 1/0 # Expected: ## To Infinity ## And ## Beyond # # You can use logic if you want: # if 0: blah blah # # Ho hum is # Expected:s s## Rzi( RRRFRRRRsRnR}tpopR(RVRtpieceRsR((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyR" s9  4.cCs{t|}tj|}g|D]}|j|kr%|^q%}|s^t|dn|d}t|j}|S(sExtract the test sources from a doctest docstring as a script. Provide the module (or dotted name of the module) containing the test to be debugged and the name (within the module) of the object with the doc string with tests to be debugged. snot found in testsi(RRRRlR-RR"R(RPR-RR)Rttestsrc((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyR# s ( cCs t|}t|||dS(s4Debug a single doctest docstring, in argument `src`'N(R"t debug_script(tsrctpmR=R((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyR$ s cCsddl}tjdd}t|d}|j||jz|r\|j}ni}|ryt|||Wqtj dGH|j tj dqXn|j d|||Wdt j |XdS( s7Debug a test script. `src` is the script, as a string.iNs.pyt doctestdebugRxiis execfile(%r)(RttempfiletmktempR`R4RbRR'RKR]t post_mortemR<Rtremove(RRR=Rt srcfilenameR(((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyR s"   cCs2t|}t||}t|||jdS(sDebug a single doctest docstring. Provide the module (or dotted name of the module) containing the test to be debugged and the name (within the module) of the object with the docstring with tests to be debugged. N(RRR#RR(RPR-RR((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyR% s t _TestClasscBs)eZdZdZdZdZRS(s A pointless class, for sanity-checking of docstring testing. Methods: square() get() >>> _TestClass(13).get() + _TestClass(-12).get() 1 >>> hex(_TestClass(13).square().get()) '0xa9' cCs ||_dS(sval -> _TestClass object with associated value val. >>> t = _TestClass(123) >>> print t.get() 123 N(R(RgR((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyR% scCs|jd|_|S(sosquare() -> square TestClass's associated value >>> _TestClass(13).square().get() 169 i(R(Rg((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pytsquare/ scCs|jS(s}get() -> return TestClass's associated value. >>> x = _TestClass(-42) >>> print x.get() -42 (R(Rg((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyR99 s(RCRkRRRR9(((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyR s  s Example of a string object, searched as-is. >>> x = 1; y = 2 >>> x + y, x * y (3, 2) Rs In 2.2, boolean expressions displayed 0 or 1. By default, we still accept them. This can be disabled by passing DONT_ACCEPT_TRUE_FOR_1 to the new optionflags argument. >>> 4 == 4 1 >>> 4 == 4 True >>> 4 > 4 0 >>> 4 > 4 False sbool-int equivalences Blank lines can be marked with : >>> print 'foo\n\nbar\n' foo bar s blank liness If the ellipsis flag is used, then '...' can be used to elide substrings in the desired output: >>> print range(1000) #doctest: +ELLIPSIS [0, 1, 2, ..., 999] tellipsiss| If the whitespace normalization flag is used, then differences in whitespace are ignored. >>> print range(30) #doctest: +NORMALIZE_WHITESPACE [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29] swhitespace normalizationcCs tj}|jtdS(N(RstTextTestRunnerR<R(RX((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyt_testu s R(XRGt NameErrorRRt __docformat__t__all__R7RKRZRDRRRTRlRsRLRRR2tsetuptools.compatR&R'R(R)R*tfilterwarningsR4RCR,RRRRR R R R R RRRRHRmRRARRRXRbRcRyR}RR~RRRRRRRt ExceptionRRRR:RYRrRqRRRRRpR!RtRrRRRR R"R#R$RR%RRR(((sE/opt/freeware/lib/python2.7/site-packages/setuptools/tests/doctest.pyt s    *  T0 (                 1  $5<+n r  vA $? F P  ,