rfc@sdZddlZddlZddlmZddlmZeZde fdYZ dej fd YZ d e fd YZ dS( s Running testsiNi(tresult(tregisterResultt_WritelnDecoratorcBs,eZdZdZdZddZRS(s@Used to decorate file-like objects with a handy 'writeln' methodcCs ||_dS(N(tstream(tselfR((s'/usr/lib64/python2.7/unittest/runner.pyt__init__scCs+|dkrt|nt|j|S(NRt __getstate__(sstreams __getstate__(tAttributeErrortgetattrR(Rtattr((s'/usr/lib64/python2.7/unittest/runner.pyt __getattr__s cCs'|r|j|n|jddS(Ns (twrite(Rtarg((s'/usr/lib64/python2.7/unittest/runner.pytwritelnsN(t__name__t __module__t__doc__RR tNoneR (((s'/usr/lib64/python2.7/unittest/runner.pyR s  tTextTestResultcBseZdZddZddZdZdZdZdZdZ d Z d Z d Z d Z d ZdZRS(shA test result class that can print formatted text results to a stream. Used by TextTestRunner. t=iFt-cCsPtt|j|||||_|dk|_|dk|_||_dS(Ni(tsuperRRRtshowAlltdotst descriptions(RRRt verbosity((s'/usr/lib64/python2.7/unittest/runner.pyR$s  cCsB|j}|jr4|r4djt||fSt|SdS(Ns (tshortDescriptionRtjointstr(Rttesttdoc_first_line((s'/usr/lib64/python2.7/unittest/runner.pytgetDescription+s cCs\tt|j||jrX|jj|j||jjd|jjndS(Ns ... (RRt startTestRRR Rtflush(RR((s'/usr/lib64/python2.7/unittest/runner.pyR 2s  cCs_tt|j||jr2|jjdn)|jr[|jjd|jjndS(Ntokt.( RRt addSuccessRRR RR R!(RR((s'/usr/lib64/python2.7/unittest/runner.pyR$9s   cCsbtt|j|||jr5|jjdn)|jr^|jjd|jjndS(NtERRORtE( RRtaddErrorRRR RR R!(RRterr((s'/usr/lib64/python2.7/unittest/runner.pyR'As   cCsbtt|j|||jr5|jjdn)|jr^|jjd|jjndS(NtFAILtF( RRt addFailureRRR RR R!(RRR(((s'/usr/lib64/python2.7/unittest/runner.pyR+Is   cCsktt|j|||jr>|jjdj|n)|jrg|jjd|jj ndS(Ns skipped {0!r}ts( RRtaddSkipRRR tformatRR R!(RRtreason((s'/usr/lib64/python2.7/unittest/runner.pyR-Qs   cCsbtt|j|||jr5|jjdn)|jr^|jjd|jjndS(Nsexpected failuretx( RRtaddExpectedFailureRRR RR R!(RRR(((s'/usr/lib64/python2.7/unittest/runner.pyR1Ys   cCs_tt|j||jr2|jjdn)|jr[|jjd|jjndS(Nsunexpected successtu( RRtaddUnexpectedSuccessRRR RR R!(RR((s'/usr/lib64/python2.7/unittest/runner.pyR3as   cCsL|js|jr"|jjn|jd|j|jd|jdS(NR%R)(RRRR tprintErrorListterrorstfailures(R((s'/usr/lib64/python2.7/unittest/runner.pyt printErrorsiscCsxxq|D]i\}}|jj|j|jjd||j|f|jj|j|jjd|qWdS(Ns%s: %ss%s(RR t separator1Rt separator2(RtflavourR5RR(((s'/usr/lib64/python2.7/unittest/runner.pyR4os #(RRRR8R9RRR R$R'R+R-R1R3R7R4(((s'/usr/lib64/python2.7/unittest/runner.pyRs            tTextTestRunnercBsDeZdZeZejedeeddZ dZ dZ RS(sA test runner class that displays results in textual form. It prints out the names of tests as they are run, errors as they occur, and a summary of the results at the end of the test run. icCsOt||_||_||_||_||_|dk rK||_ndS(N(RRRRtfailfasttbufferRt resultclass(RRRRR<R=R>((s'/usr/lib64/python2.7/unittest/runner.pyRs     cCs|j|j|j|jS(N(R>RRR(R((s'/usr/lib64/python2.7/unittest/runner.pyt _makeResultscCs|j}t||j|_|j|_tj}t|dd}|dk rb|nz||Wdt|dd}|dk r|nXtj}||}|jt|dr|j j |j n|j }|j j d||dkr dpd|f|j j d } } } y%t t|j|j|jf} Wntk rlnX| \} } } g} |js|j jd t t|j|jf\}}|r| jd |n|r| jd |qn|j jd | r | jd| n| r:| jd| n| rT| jd| n| r}|j j ddj| fn|j jd|S(s&Run the given test case or test suite.t startTestRunNt stopTestRunR9sRan %d test%s in %.3fsiR,titFAILEDs failures=%ds errors=%dtOKs skipped=%dsexpected failures=%dsunexpected successes=%ds (%s)s, s (R?RR<R=ttimeRRR7thasattrRR R9ttestsRuntmaptlentexpectedFailurestunexpectedSuccessestskippedRt wasSuccessfulR R6R5tappendR(RRRt startTimeR@RAtstopTimet timeTakentrunt expectedFailsRKRLtresultstinfostfailedterrored((s'/usr/lib64/python2.7/unittest/runner.pyRRsb              #    !#N( RRRRR>tsyststderrtTruetFalseRRR?RR(((s'/usr/lib64/python2.7/unittest/runner.pyR;ws   (RRXRERBRtsignalsRRZt __unittesttobjectRt TestResultRR;(((s'/usr/lib64/python2.7/unittest/runner.pyts  [