Files
PowerToys/PythonHome/Lib/unittest/runner.pyc

46 lines
7.2 KiB
Plaintext
Raw Normal View History

2014-07-09 18:15:23 +08:00
<03>
<EFBFBD>W`Sc@s<>dZddlZddlZddlmZddlmZeZde fd<00><00>YZ
dej fd <00><00>YZ d
e fd <00><00>YZ dS( s Running testsi<73><69><EFBFBD><EFBFBD>Ni(tresult(tregisterResultt_WritelnDecoratorcBs,eZdZd<00>Zd<00>Zdd<00>ZRS(s@Used to decorate file-like objects with a handy 'writeln' methodcCs ||_dS(N(tstream(tselfR((s.\Lib\unittest\runner.pyt__init__scCs+|dkrt|<00><00>nt|j|<00>S(NRt __getstate__(sstreams __getstate__(tAttributeErrortgetattrR(Rtattr((s.\Lib\unittest\runner.pyt __getattr__s cCs'|r|j|<00>n|jd<00>dS(Ns
(twrite(Rtarg((s.\Lib\unittest\runner.pytwritelnsN(t__name__t
__module__t__doc__RR
tNoneR (((s.\Lib\unittest\runner.pyR s  tTextTestResultcBs<>eZdZddZddZd<00>Zd<00>Zd<00>Zd<00>Zd<00>Z d <00>Z
d
<00>Z d <00>Z d <00>Z d <00>Zd<00>ZRS(shA test result class that can print formatted text results to a stream.
Used by TextTestRunner.
t=iFt-cCsPtt|<00>j|||<00>||_|dk|_|dk|_||_dS(Ni(tsuperRRRtshowAlltdotst descriptions(RRRt verbosity((s.\Lib\unittest\runner.pyR$s
 cCsB|j<00>}|jr4|r4djt|<00>|f<00>St|<00>SdS(Ns
(tshortDescriptionRtjointstr(Rttesttdoc_first_line((s.\Lib\unittest\runner.pytgetDescription+s cCs\tt|<00>j|<00>|jrX|jj|j|<00><00>|jjd<00>|jj<00>ndS(Ns ... (RRt startTestRRR Rtflush(RR((s.\Lib\unittest\runner.pyR 2s
 cCs_tt|<00>j|<00>|jr2|jjd<00>n)|jr[|jjd<00>|jj<00>ndS(Ntokt.( RRt
addSuccessRRR RR R!(RR((s.\Lib\unittest\runner.pyR$9s   cCsbtt|<00>j||<00>|jr5|jjd<00>n)|jr^|jjd<00>|jj<00>ndS(NtERRORtE( RRtaddErrorRRR RR R!(RRterr((s.\Lib\unittest\runner.pyR'As   cCsbtt|<00>j||<00>|jr5|jjd<00>n)|jr^|jjd<00>|jj<00>ndS(NtFAILtF( RRt
addFailureRRR RR R!(RRR(((s.\Lib\unittest\runner.pyR+Is   cCsktt|<00>j||<00>|jr>|jjdj|<00><00>n)|jrg|jjd<00>|jj <00>ndS(Ns skipped {0!r}ts(
RRtaddSkipRRR tformatRR R!(RRtreason((s.\Lib\unittest\runner.pyR-Qs   cCsbtt|<00>j||<00>|jr5|jjd<00>n)|jr^|jjd<00>|jj<00>ndS(Nsexpected failuretx( RRtaddExpectedFailureRRR RR R!(RRR(((s.\Lib\unittest\runner.pyR1Ys   cCs_tt|<00>j|<00>|jr2|jjd<00>n)|jr[|jjd<00>|jj<00>ndS(Nsunexpected successtu( RRtaddUnexpectedSuccessRRR RR R!(RR((s.\Lib\unittest\runner.pyR3as   cCsL|js|jr"|jj<00>n|jd|j<00>|jd|j<00>dS(NR%R)(RRRR tprintErrorListterrorstfailures(R((s.\Lib\unittest\runner.pyt printErrorsiscCsxxq|D]i\}}|jj|j<00>|jjd||j|<00>f<16>|jj|j<00>|jjd|<16>qWdS(Ns%s: %ss%s(RR t
separator1Rt
separator2(RtflavourR5RR(((s.\Lib\unittest\runner.pyR4os
#(RRRR8R9RRR R$R'R+R-R1R3R7R4(((s.\Lib\unittest\runner.pyRs

          tTextTestRunnercBsDeZdZeZejedeedd<00>Z
d<00>Z d<00>Z RS(s<>A 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|<00>|_||_||_||_||_|dk rK||_ndS(N(RRRRtfailfasttbufferRt resultclass(RRRRR<R=R>((s.\Lib\unittest\runner.pyRs     cCs|j|j|j|j<00>S(N(R>RRR(R((s.\Lib\unittest\runner.pyt _makeResult<6C>scCs<>|j<00>}t|<00>|j|_|j|_tj<00>}t|dd<00>}|dk rb|<00>nz||<00>Wdt|dd<00>}|dk r<>|<00>nXtj<00>}||}|j<00>t|d<00>r<>|j j
|j <00>n|j }|j j
d||dkr dpd|f<16>|j j
<00>d } }
} y%t t|j|j|jf<00>} Wntk
rlnX| \} }
} g} |j<00>s<>|j jd
<00>t t|j|jf<00>\}}|r<>| jd |<16>n|r| jd |<16>qn|j jd <00>| r | jd| <16>n| r:| jd| <16>n|
rT| jd|
<16>n| r}|j j
ddj| <00>f<16>n|j jd<00>|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.\Lib\unittest\runner.pyRR<00>sb 
    
   

  #    !#N( RRRRR>tsyststderrtTruetFalseRRR?RR(((s.\Lib\unittest\runner.pyR;ws   (RRXRERBRtsignalsRRZt
__unittesttobjectRt
TestResultRR;(((s.\Lib\unittest\runner.pyt<module>s  [