ϪfdZddlZddlZddlZddlZddlmZddlmZm Z ddl m Z ddl m ZmZmZddlmZmZmZmZddlmZdd lmZdd lmZmZmZm Z mZdd l m!Z!m"Z"dd l#m$Z$m%Z%dd l&m'Z'm(Z(m)Z)ddl*m+Z+m,Z,m-Z-ddl.m/Z/GddZ0Gdde jbZ2Gdde jbZ3Gdde3Z4Gdde2Z5Gdde5Z6Gdde jbZ7Gd d!e2Z8Gd"d#e jbZ9Gd$d%e jbZ:Gd&d'e jbZ;Gd(d)e jbZ<Gd*d+e<Z=Gd,d-e jbZ>Gd.d/e>Z?Gd0d1Z@Gd2d3e jbZAGd4d5e jbZBGd6d7eBZCGd8d9e jbZDGd:d;eBZEGd<d=e jbZFGd>d?eCZGGd@dAejZIGdBdCe jbZJGdDdEZKGdFdGe jbZLGdHdIe jbZMy)Jz& Tests for L{twisted.trial.reporter}. N)getmro)BytesIOStringIO)Type)TestCase TestSuiteexpectedFailure) assert_thatequal_tohas_item has_lengthlog)Failure)itrialreporterrunnerunittestutil)UncleanWarningsReporterWrapper _ExitWrapper) erroneoussample)SkipTestTodomakeTodo) isFailurematches_result similarFrame)afterc*eZdZdZdZdZdZdZdZy) BrokenStreamz Stream-ish object that raises a signal interrupt error. We use this to make sure that Trial still manages to write what it needs to write. Fc||_yN)fObj)selfr's B/usr/lib/python3/dist-packages/twisted/trial/test/test_reporter.py__init__zBrokenStream.__init__,  c|jr|jj|Sd|_ttj d)NTzInterrupted write)writtenr'writeOSErrorerrnoEINTR)r(ss r)r/zBrokenStream.write/s5 <<99??1% % ekk#677r,c|jr|jjSd|_ttj d)NTzInterrupted flush)flushedr'flushr0r1r2r(s r)r6zBrokenStream.flush5s3 <<99??$ $ ekk#677r,N) __name__ __module__ __qualname____doc__r.r5r*r/r6r,r)r$r$#s" GG8 8r,r$ceZdZdZy) StringTestc ttd|}|jt|t|kdt|t|fzt t j d}tt||D]\}\}}| t|tr|j||d|||fz6t||r2|j|j|d||j|fzttd|y)Nz2Must have more observed than expectedlines %d < %dzLine %d: %r not in %rz#Line %d: %r did not match string %rz"don't know what to do with object )listfilter assertTruelentyperecompile enumeratezip isinstancestrassertSubstringmatchpattern TypeError)r(expectoutputREGEX_PATTERN_TYPE line_numberexpouts r)stringComparisonzStringTest.stringComparison=sfT6*+  K3v; & "6{CK8 9 ""**R.1'0VV1D'E N #K#s{C%$$5c38OOC!34IIcN9"CKK56  "DSG LMM Nr,N)r8r9r:rVr<r,r)r>r><sNr,r>c$eZdZdZdZdZdZy)TestResultTestsc6tj|_yr&)r TestResultresultr7s r)setUpzTestResultTests.setUpWs))+ r,cX td#t$r:}|}|jj|tjYd}~nd}~wwxYw|jj dd}|j ||j|j t|jyNfoorr!) RuntimeErrorr[addErrorsysexc_infoerrors assertEqualvaluerEr(eexcValuefailures r)test_pyunitAddErrorz#TestResultTests.test_pyunitAddErrorZs 7u% % 7H KK s||~ 6 6 7++$$Q'* 7==1 w||4s A0A  Ac| |jd#|j$r:}|}|jj|tjYd}~nd}~wwxYw|jj dd}|j ||j|j |j|jyr^) failureExceptionr[ addFailurerbrcfailuresrerfrErgs r)test_pyunitAddFailurez%TestResultTests.test_pyunitAddFailurees 9''. .$$ 9H KK " "4 8 8 9++&&q)!, 7==1 .. =sA0AAc|jt5|jj|dddd|jt5|jj|t dddd|jt5|jj|tt dddfddd|jt5|jj|tt dfdddy#1swYxYw#1swYxYw#1swYkxYw#1swYyxYw)z L{reporter.TestResult.addError} raises L{TypeError} if it is called with an error that is neither a L{sys.exc_info}-like three-tuple nor a L{Failure}. zan errorNextra) assertRaisesrOr[ra Exceptionr7s r)test_somethingElsez"TestResultTests.test_somethingElseps    y ) 3 KK z 2 3   y ) > KK y'< = >   y )  KK y)J"7wG    y ) K KK  9Z3H'I J K K 3 3 > >   K Ks/D&D.D+,D7DD(+D47EN)r8r9r:r\rkrprur<r,r)rXrXVs, 5 >Kr,rXceZdZdZy)ReporterRealtimeTestscPt}tj|d|_y)NT)realtime)rrReporterr[r(rQs r)r\zReporterRealtimeTests.setUps''> r,N)r8r9r:r\r<r,r)rwrws?r,rwc|eZdZejdZd dZdZdede jfdZ dZ d Z d Zd d Zy) ErrorReportingTestsz^=+$returnNctj|_t|_t j |j|_yr&)r TestLoaderloaderrrQrrzr[r7s r)r\zErrorReportingTests.setUps1'') j )1):):4;;)G r,cx|j|}|j|jjSr&) getResultdonerQgetvalue)r(suiter[s r) getOutputzErrorReportingTests.getOutputs,& {{##%%r,rcP|j|j|jSr&)runr[r(rs r)rzErrorReportingTests.getResults $++{{r,c btj}|jj|}|j |j }|j ddtjdtjdd|jd|jdg}|j||y) z A test method which runs and has an error recorded against it is reported in the output stream with the I{ERROR} tag along with a summary of what error was reported and the ID of the test. z[ERROR]"Traceback (most recent call last):z.^\s+File .*erroneous\.py., line \d+, in setUp$z5^\s+raise FoolishError..I am a broken setUp method..$zEtwisted.trial.test.erroneous.FoolishError: I am a broken setUp method.z .test_noopN) rSynchronousTestFailureInSetUpr loadClassr splitlinesdoubleSeparatorrFrGr9r8rV)r(clsrrQrMs r)test_formatErroredMethodz,ErrorReportingTests.test_formatErroredMethods 55 %%c*&113   0 JJH I JJS T-~~a ~Z 8   eV,r,c|jjd}|j|j}|jddt j dt j dddg}|j||y)z A test method which runs and has a failure recorded against it is reported in the output stream with the I{FAIL} tag along with a summary of what failure was reported and the ID of the test. z6twisted.trial.test.erroneous.TestRegularFail.test_failz[FAIL]rz2^\s+File .*erroneous\.py., line \d+, in test_fail$z^\s+self\.fail\("I fail"\)$z'twisted.trial.unittest.FailTest: I failN)r loadByNamerrrrFrGrV)r(rrQrMs r)test_formatFailedMethodz+ErrorReportingTests.test_formatFailedMethods|  && D &113   0 JJL M JJ5 6 5 D  eV,r,cddlm}tj|jj |t j}|j|}d}ddd|fD]}|j|||jtjd|d|jtjd g}|j||j!y ) z A problem encountered while running a doctest is reported in the output stream with a I{FAIL} or I{ERROR} tag along with a summary of what problem was encountered and the ID of the test. r)rz0twisted.trial.test.erroneous.unexpectedExceptionz1/0ZeroDivisionErrorzException raised:zFail(ed|ure in) example:z;Couldn't match 'Failure in example: ' or 'Failed example: 'z\[(ERROR|FAIL)\]N)twisted.trial.testrrdecorater loadDoctestsr ITestCaserrLrCrFsearchrrGrVr)r(rrrQpath substringrPs r)test_doctestErrorz%ErrorReportingTests.test_doctestErrors 1!!$++":":9"EvGWGWX&A!46I4P 4I  F 3 4  II0& 9 L && 3F(GH ff&7&7&9:r,c tjd}|jt|g}t |t t dt d|j\\}}t |t|t |ttttttdttdd|j\\}}t |t|t |tt|j tttdttddy ) a When a function scheduled using L{IReactorTime.callLater} in a test method raises an exception that exception is added to the test result as an error. This happens even if the test also fails and the test failure is also added to the test result as a failure. Only really necessary for testing the deprecated style of tests that use iterate() directly. See L{erroneous.DelayedCall.testHiddenException} for more details. testHiddenExceptionr!)rdrozsomething blew upgoz erroneous.py)rErfframesz/Deliberate failure to mask the hidden exceptionN)r DelayedCallrPyUnitTestSuiter rr rdr rr`r"rKr r rorm)r(testr[ actualCaseerrorrjs r)test_hiddenExceptionz(ErrorReportingTests.test_hiddenExceptions $$%:; 78 N*Q-*Q-P !'  *eD(:./  l+C*=!>? T> BC  #)// *gD(:./  d334"ST -BN ST   r,r~N)r8r9r:rFrGrr\rrrrzrrrrrr<r,r)r}r}sJ bjj)OH & 83D3D-.-*;() r,r}c<eZdZdZddZdedejfdZy)(UncleanWarningWrapperErrorReportingTestsz Tests that the L{UncleanWarningsReporterWrapper} can sufficiently proxy IReporter failure and error reporting methods to a L{reporter.Reporter}. r~Nctj|_t|_t j |j|_t|j |_yr&) rrrrrQrrzrr[r7s r)r\z.UncleanWarningWrapperErrorReportingTests.setUp sA'') j +3+<+? N  O ^,c..ABr,cvtjd}|j|}|j|dgy)N test_fail)rtwisted/trial/test/erroneousrTestRegularFailrrr(rrs r) test_basicz!TracebackHandlingTests.test_basic0s6((5$$T* "O!PQr,cxtjd}|j|}|j|ddgy)N test_subfail)rr) subroutinerrrs r)test_subroutinez&TracebackHandlingTests.test_subroutine5s>((8$$T*  @>  r,cvtjd}|j|}|j|dgy)z C{_trimFrames} removes traces of C{_runCallbacks} when getting an error in a callback returned by a C{TestCase} based test. r)cbztwisted/internet/taskNrTestAsynchronousFailrrrs r) test_deferredz$TracebackHandlingTests.test_deferred@s? --k:$$T*  0  r,cptjd}|jg|jgyr&rrzrerr(r[s r) test_noFramesz$TracebackHandlingTests.test_noFramesPs-""4( V//34r,cttjd}|jdg|jdgy)Nz fake framerrs r) test_oneFramez$TracebackHandlingTests.test_oneFrameTs1""4( ,););\N)KLr,cvtjd}|j|}|j|dgy)z C{_trimFrames} removes traces of C{runWithWarningsSuppressed} from C{utils} when a synchronous exception happens in a C{TestCase} based test. test_exception)rrNrrs r)rz%TracebackHandlingTests.test_exceptionXs9 --.>?$$T* "T!UVr,N) r8r9r:rrrrrrrrr<r,r)rrs.5"CR   5MWr,rc$eZdZdZdZdZdZy)FormatFailuresTestsc td#t$rt|_YnwxYwddddgdggddddgd ggg|j_t |_t j|j |_y) Nr_z foo/bar.py)xr)yorangequx )atwo)bMCMXCIX) r`rfrrrrrzr[r7s r)r\zFormatFailuresTests.setUpds u% % YDF L!hZ/1B C L"|n7G6H I  j '' 4 s ((c |jj|j}|jddt j ddt j ddg|j y)Nrz# File "foo/bar.py", line 5, in fooz^\s*$z$ File "foo/bar.py", line 10, in quxzRuntimeError: foo)r[_formatFailureTracebackrrVrFrGr)r(tbs r)test_formatDefaultz&FormatFailuresTests.test_formatDefaultps\ [[ 0 0 8 45 8$6 8$#   MMO r,cfd}d}|jj|}|j||y)Nz File "twisted/trial/unittest.py", line 256, in failUnlessSubstring return self.failUnlessIn(substring, astring, msg) exceptions.TypeError: iterable argument required z File "twisted/trial/unittest.py", line 256, in failUnlessSubstring return self.failUnlessIn(substring, astring, msg) exceptions.TypeError: iterable argument required )r[rre)r(rr formatteds r)test_formatStringz%FormatFailuresTests.test_formatString~s6  KK77;  9-r,c|jjdd}|jj|j|j |jj|yr&)rrr[rre)r(rs r) test_mutationz!FormatFailuresTests.test_mutationsBq! ++DFF3 /r,N)r8r9r:r\rrrr<r,r)rrcs 5   .0r,rc6eZdZdZdZdZdZdZdZdZ y) PyunitNamesTestscVt|_tjd|_yNtest_foo)rrr PyunitTestrr7s r)r\zPyunitNamesTests.setUpsj %%j1 r,ctj|j}|j|j|jj }|j |dy)Nz2twisted.trial.test.sample.PyunitTest.test_foo ... )rVerboseTextReporterr startTestrrrer(r[rQs r)test_verboseReporterz%PyunitNamesTests.test_verboseReportersK--dkk:#%%' !UVr,cJtj|j}|j|j|jj }|j dj}|j||j|jdzyNz ... r TreeReporterrrrrrstripregetDescriptionrs r)test_treeReporterz"PyunitNamesTests.test_treeReporterz&&t{{3#%%'""$R(..0 !6!6tyy!AF!JKr,ctj|j}|j|j}|j |dyrrrrrrrers r)test_getDescriptionz$PyunitNamesTests.test_getDescription:&&t{{3&&tyy1 ,r,c4tj|j}|jj ||j |jj jjd}|j|ddgdy)a The summary of L{reporter.MinimalReporter} is a simple list of numbers, indicating how many tests ran, how many failed etc. The numbers represents: * the run time of the tests * the number of tests run, printed 2 times for legacy reasons * the number of errors * the number of failures * the number of skips  r!N)1r 0rr) rMinimalReporterrrr _printSummaryrrrrers r)test_minimalReporterz%PyunitNamesTests.test_minimalReportersq))$++6 f%%'--/55c: %>?r,cRgdtj|j}fd|_|jj ||j |jjjjd}|d}|j|dy)zt L{reporter.MinimalReporter} reports the time to run the tests as first data in its output. )g?g333333?g?gffffff?c&jdSNr)pop)timessr)z;PyunitNamesTests.test_minimalReporterTime..s%))A,r,r rz0.7N) rrr_getTimerrrrrrre)r(r[rQtimerrs @r)test_minimalReporterTimez)PyunitNamesTests.test_minimalReporterTimes %))$++6. f%%'--/55c:q  &r,ctj|j}|j|jj j j d}|j|gdy)zv The summary of L{reporter.MinimalReporter} is a list of zeroes when no test is actually run. r )rrrrrrN)rrrrrrrrers r)test_emptyMinimalReporterz*PyunitNamesTests.test_emptyMinimalReporters[ ))$++6%%'--/55c: !?@r,N) r8r9r:r\rrr rrrr<r,r)rrs)2W L- @$ 'Ar,rc.eZdZdZdZdZdZdZdZy)DirtyReactorTestsz The trial script has an option to treat L{DirtyReactorAggregateError}s as warnings, as a migration tool for test authors. It causes a wrapper to be placed around reporters that replaces L{DirtyReactorAggregatErrors} with warnings. cttjdgdg|_t |_t d|_y)Nr_bartest_errorByDefault)rrDirtyReactorAggregateError dirtyErrorrrQrrr7s r)r\zDirtyReactorTests.setUps5!$"A"A5'E7"STj %&;< r,c2tj|j}|j|j|j |j t|jd|j |jdd|j y)zj L{DirtyReactorAggregateError}s are reported as errors with the default Reporter. rr!rN) rrzrQrarr#rerDrdrs r)r!z%DirtyReactorTests.test_errorByDefaultsi ""$++6 4??3 V]]+Q/ q)!,doo>r,cttj|j}|j t |j jtj|j|j|j y)z L{DirtyReactorAggregateError}s are reported as warnings when using the L{UncleanWarningsReporterWrapper}. r%N) rrrzrQ assertWarns UserWarningr#getErrorMessage__file__rarrs r)test_warningsEnabledz&DirtyReactorTests.test_warningsEnableds\ 00A0A0UV   OO + + -    OO II OO  r,c^ttj|j}|j t |j jtj|j|j|j |j|jjgy)z L{DirtyReactorAggregateError}s are I{not} reported as errors if the L{UncleanWarningsReporterWrapper} is used. r%N)rrrzrQr'r(r#r)r*rarre_originalReporterrdrs r)test_warningsMaskErrorsz)DirtyReactorTests.test_warningsMaskErrorssz 00A0A0UV   OO + + -    OO II OO   1188"=r,cjttj|j}|j |j |j j|j jdf|jt|jjd|j|jjddj|j j|j|jjddj|j jy)a Some annoying stuff can pass three-tuples to addError instead of Failures (like PyUnit). The wrapper, of course, handles this case, since it is a part of L{twisted.trial.itrial.IReporter}! But it does not convert L{DirtyReactorAggregateError} to warnings in this case, because nobody should be passing those in the form of three-tuples. r%Nr!r) rrrzrQrarr#rErfrerDr-rdrs r)test_dealsWithThreeTuplesz+DirtyReactorTests.test_dealsWithThreeTuples s00A0A0UV DOO$8$8$//:O:OQU#VW V55<<=qA   $ $ + +A .q 1 6 68L8L    $ $ + +A .q 1 7 79N9N r,N) r8r9r:r;r\r!r+r.r0r<r,r)rrs = ?  >  r,rc*eZdZdZdZdZdZdZy)TrialNamesTestscVt|_tjd|_yr)rrrFooTestrr7s r)r\zTrialNamesTests.setUp sj NN:. r,ctj|j}|j|j|jj }|j ||jjdzy)Nz ... )rrrrrrreidrs r)rz$TrialNamesTests.test_verboseReporter$sY--dkk:#%%' '!9:r,cJtj|j}|j|j|jj }|j dj}|j||j|jdzyrrrs r)rz!TrialNamesTests.test_treeReporter*rr,ctj|j}|j|j |dy)z A docstringtest_treeReporterWithDocstringsN)rrrrerrs r)r9z/TrialNamesTests.test_treeReporterWithDocstrings1s2&&t{{3 ..t46WXr,ctj|j}|j|j}|j |dyrrrs r)r z#TrialNamesTests.test_getDescription6r r,N)r8r9r:r\rrr9r r<r,r)r2r2s/; LY -r,r2c@eZdZdZdZdZdZdZdZdZ dZ d Z y ) SkipTestsz= Tests for L{reporter.Reporter}'s handling of skips. ct|_tj|j|_t j d|_yrrrrrzr[rr4rr7s r)r\zSkipTests.setUpA1j '' 4 NN:. r,c,t|jS)zF Get the number of skips that happened to a reporter. )rDskipsrs r) _getSkipszSkipTests._getSkipsFs6<<  r,c|jj|jd|j|j |jdy)N some reasonr!)r[addSkiprrerBr7s r)test_accumulationzSkipTests.test_accumulationLs7 DII}5  4a8r,c|jj|jd|jd|jj y)NrDT)r[rErre wasSuccessfulr7s r) test_successzSkipTests.test_successPs7 DII}5 t{{88:;r,cv|jj|jd|jj|jj j d}d}|j|j||j|t|djdy)z The summary of a successful run with skips indicates that the test suite passed and includes the number of skips. rDrPASSED Nz (skips=1)) r[rErrrrrrC startswithrerDrr(rQprefixs r) test_summaryzSkipTests.test_summaryTs DII}5 %%'224R8 ))&12 F .446 Dr,c|jj|jd|jj|jj j d}|j|jdy)zw The output at the end of a test run with skips includes the reasons for skipping those tests. rDN) r[rErrrrrrerr{s r)test_basicErrorszSkipTests.test_basicErrors`sb DII}5 %%'224Q7 7r,c|jj|jd|jj|jj j d}|j|dy)z Tests can be skipped without specifying a reason by setting the 'skip' attribute to True. When this happens, the test output includes 'True' as the reason. TrQTrueN)r[rErrrrrrer{s r)test_booleanSkipzSkipTests.test_booleanSkipjs\ DIIt, %%'224Q7 (r,c ddz |jj|j|jj dj |j jjddj}|j|t|y#t$r }|}Yd}~d}~wwxYw)z Skips can be raised as errors. When this happens, the error is included in the summary at the end of the test suite. r!rN rQr) rtr[rErrjoinrrrrrerKr(rhrrQs r)test_exceptionSkipzSkipTests.test_exceptionSkipus   E DIIu- 4;;//1<<>qCDJJL U,  E sB++ C4B;;CN) r8r9r:r;r\rBrFrIrOrRrUrZr<r,r)r<r<<s0/ ! 9< E8 ) -r,r<ceZdZdZdZdZy)UncleanWarningSkipTestszh Tests for skips on a L{reporter.Reporter} wrapped by an L{UncleanWarningsReporterWrapper}. cbtj|t|j|_yr&)r<r\rr[r7s r)r\zUncleanWarningSkipTests.setUp4T[[A r,c@t|jjS)z} Get the number of skips that happened to a reporter inside of an unclean warnings reporter wrapper. )rDr-rArs r)rBz!UncleanWarningSkipTests._getSkipss 6++1122r,N)r8r9r:r;r\rBr<r,r)r\r\s B3r,r\cdeZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZdZdZy) TodoTestsz= Tests for L{reporter.Reporter}'s handling of todos. ct|_tj|j|_t j d|_yrr>r7s r)r\zTodoTests.setUpr?r,c|jS)zH Get the expected failures that happened to a reporter. )expectedFailuresrs r) _getTodoszTodoTests._getTodoss&&&r,c|jS)zK Get the unexpected successes that happened to a reporter. )unexpectedSuccessesrs r)_getUnexpectedSuccessesz!TodoTests._getUnexpectedSuccessess)))r,c|jj|jtt t d|j t|j|jdy)zh L{reporter.Reporter} accumulates the expected failures that it is notified of. todo!r!N) r[addExpectedFailurerrrtrrerDrer7s r)rFzTodoTests.test_accumulationsQ && IIwy{+Xg->  T^^DKK891=r,cntt}|jj|j||j |j\\}}}|j ||j|j |||j t|ttdy)z If no C{Todo} is provided to C{addExpectedFailure}, then L{reporter.Reporter} makes up a sensible default. This allows standard Python unittests to use Twisted reporters. Test expected to failN) rrtr[rkrrerereprr)r(rjrrtodos r)test_noTodoProvidedzTodoTests.test_noTodoProvideds)+& &&tyy': $t{{ ; $t tyy) ( dT(3J*K%LMr,c|jj|jtt t d|j d|jjy)zU A test run is still successful even if there are expected failures. rjTN)r[rkrrrtrrerHr7s r)rIzTodoTests.test_successsL && IIwy{+Xg->  t{{88:;r,c|jj|jtd|j d|jj |j t |j|jdy)z A test which is marked as todo but succeeds will have an unexpected success reported to its result. A test run is still successful even when this happens. zHeya!Tr!N)r[addUnexpectedSuccessrrrerHrDrhr7s r)test_unexpectedSuccessz TodoTests.test_unexpectedSuccesssb ((HW4EF t{{88:; T99$++FGKr,c |jj|j|j|j\\}}|j ||j|j t |t t dy)aL A test which is marked as todo but succeeds will have an unexpected success reported to its result. A test run is still successful even when this happens. If no C{Todo} is provided, then we make up a sensible default. This allows standard Python unittests to use Twisted reporters. rmN)r[rsrrhrernrr(rros r)test_unexpectedSuccessNoTodoz&TodoTests.test_unexpectedSuccessNoTodosg ((355dkkB$ tyy) dT(3J*K%LMr,c|jj|jtt t d|jj |jjjd}d}|j|j||j|t|djdy)z{ The reporter's C{printSummary} method should print the number of expected failures that occurred. rDrrKNz(expectedFailures=1))r[rkrrrtrrrrrrCrLrerDrrMs r)rOzTodoTests.test_summarys && IIwy{+Xm-D  %%'224R8 ))&12 F .4468NOr,cP|jj|jtt t d|jj |jjjdj}|j|dy)zd The reporter's L{printErrors} method should include the value of the Todo. rDrQzReason: 'some reason'N) r[rkrrrtrrrrrrrer{s r)rRzTodoTests.test_basicErrorssy && IIwy{+Xm-D  %%'224Q7==? !89r,c|jj|jtt d|j t|jj y)z Booleans CAN'T be used as the value of a todo. Maybe this sucks. This is a test for current behavior, not a requirement. TN)r[rkrrrtrsrr7s r)test_booleanTodozTodoTests.test_booleanTodos? &&tyy')+2FM )T[[%5%56r,c ddz |jj|jt t d|jj dj|jjjddj}|jt||vy#t$r }|}Yd}~d}~wwxYw)zk The exception for expected failures should be shown in the C{printErrors} output. r!rNrjrWrQ)rtr[rkrrrrrXrrrrrCrKrYs r)test_exceptionTodozTodoTests.test_exceptionTodos   E &&tyy'%.(7BST 4;;//1<<>qrBCIIK E f,-  E sB?? CCCcGddt}|d}|j|j|jt |j |jdy)t Tests that use the standard library C{expectedFailure} feature worth with Trial reporters. ceZdZedZy)@TodoTests.test_standardLibraryCompatibilityFailure..Testc&|jdy)Nrj)failr7s r)rzJTodoTests.test_standardLibraryCompatibilityFailure..Test.test_fails )$r,N)r8r9r:r rr<r,r)Testrs  % %r,rrr!N)StdlibTestCaserr[rerDrer(rrs r)(test_standardLibraryCompatibilityFailurez2TodoTests.test_standardLibraryCompatibilityFailuresL  %> % K   T^^DKK891=r,cGddt}|d}|j|j|jt |j |jdy)rceZdZedZy)@TodoTests.test_standardLibraryCompatibilitySuccess..Testcyr&r<r7s r)rIzMTodoTests.test_standardLibraryCompatibilitySuccess..Test.test_success+sr,N)r8r9r:r rIr<r,r)rr*s   r,rrIr!N)rrr[rerDrhrs r)(test_standardLibraryCompatibilitySuccessz2TodoTests.test_standardLibraryCompatibilitySuccess$sN  >  N#  T99$++FGKr,N)r8r9r:r;r\rerhrFrprIrtrwrOrRr{r}rrr<r,r)rarasR/ ' * > N<L N P :7 . > Lr,rac"eZdZdZdZdZdZy)UncleanWarningTodoTestszJ Tests for L{UncleanWarningsReporterWrapper}'s handling of todos. cbtj|t|j|_yr&)rar\rr[r7s r)r\zUncleanWarningTodoTests.setUp9r^r,c.|jjS)zt Get the todos that happened to a reporter inside of an unclean warnings reporter wrapper. )r-rdrs r)rez!UncleanWarningTodoTests._getTodos=s ''888r,c.|jjS)z Get the number of unexpected successes that happened to a reporter inside of an unclean warnings reporter wrapper. )r-rgrs r)rhz/UncleanWarningTodoTests._getUnexpectedSuccessesDs '';;;r,N)r8r9r:r;r\rerhr<r,r)rr4sB9|jj||fyr&)rappend)r(textcolors r)r/zMockColorizer.writeTs  &r,N)r8r9r:r;r*r/r<r,r)rrLs'r,rc6eZdZdZdZdZdZdZdZdZ y) TreeReporterTestsc0tjd|_t|_t j |j|_t|j|j_ |jjj|_ yr) rr4rrrrrr[r _colorizerrr7s r)r\zTreeReporterTests.setUpYs]NN:. j ++DKK8 !.t{{!; ;;))--r,cF ddz S#t$rt}Y|SwxYw)Nr!r)rr)r(rs r) makeErrorzTreeReporterTests.makeError`s2  E!  A s    c~|jj|j|jj|j |j d|jj df|j |jjjdjdy)zw The summary in case of success should have a good count of successes and be colored properly. r!PASSEDrz (successes=1)N) r[ addSuccessrrrerSUCCESSrrrrr7s r)test_summaryColoredSuccessz,TreeReporterTests.test_summaryColoredSuccessgs tyy)  !t{{':':H&EF  KK " - - / 3 9 9 ;_ r,c td#t$r1|jj|tjYnwxYw|jj |j |jd|jjdf|j |jjjdjdy)zt The summary in case of failure should have a good count of errors and be colored properly. r_r!FAILEDrz (errors=1)N) r`r[rarbrcrrerFAILURErrrrr7s r)test_summaryColoredFailurez,TreeReporterTests.test_summaryColoredFailuress  7u% % 7 KK s||~ 6 7  !t{{':':H&EF --/::A? BA CCc d}tjd}tjd}tjd}|jj d|df|df|dfg||j |j jd|jj|j|j|jdzy ) z L{Reporter._printResults} uses the results list and formatter callable passed to it to produce groups of results to write to its output stream. ct|dzS)NrW)rK)ns r) formatterz6TreeReporterTests.test_printResults..formattersq6D= r,rrFOOr!rzW%(double separator)s FOO 1 %(first)s %(second)s %(double separator)s FOO 2 %(third)s )zdouble separatorfirstsecondthirdN) rr4rr[ _printResultsrerr_doubleSeparatorr6)r(rrrrs r)test_printResultsz#TreeReporterTests.test_printResultss !z* +!!*- !! UAJ eQZ8)   KK " %)KK$@$@ ))+   r,N) r8r9r:r\rrrrrrr<r,r)rrXs'.   X E1,# r,rcxeZdZUdZej Zeeje d<dZ dZ dZ dZdZdZd Zy ) ReporterInterfaceTestsas Tests for the bare interface of a trial reporter. Subclass this test case and provide a different 'resultFactory' to test that a particular reporter implementation will work with the rest of Trial. @cvar resultFactory: A callable that returns a reporter to be tested. The callable must take the same parameters as L{reporter.Reporter}. resultFactoryctjd|_t|_t j |_|j|j|j|_ y)Nr publisher) rr4rrrr LogPublisherrrr[r7s r)r\zReporterInterfaceTests.setUpsJNN:. j ))+(((O r,cP|jd|jjy)z4 shouldStop is False to begin with. FN)rer[ shouldStopr7s r)test_shouldStopInitiallyFalsez4ReporterInterfaceTests.test_shouldStopInitiallyFalses  6 67r,c|jj|jd|jjy)zG shouldStop becomes True soon as someone calls stop(). TN)r[stoprerr7s r)test_shouldStopTrueAfterStopz3ReporterInterfaceTests.test_shouldStopTrueAfterStops.  t{{556r,cX|jd|jjy)zS wasSuccessful() is True when there have been no results reported. TN)rer[rHr7s r)test_wasSuccessfulInitiallyTruez6ReporterInterfaceTests.test_wasSuccessfulInitiallyTrues! t{{88:;r,c|jj|j|jd|jj y)zg wasSuccessful() is True when there have been only successes, False otherwise. TN)r[rrrerHr7s r)$test_wasSuccessfulTrueAfterSuccessesz;ReporterInterfaceTests.test_wasSuccessfulTrueAfterSuccessess7 tyy) t{{88:;r,c ddz |j d|jjy#t$r;|jj|jt j YnwxYw)zP wasSuccessful() becomes False after errors have been reported. r!rFN)rr[rarrbrcrerHr7s r)"test_wasSuccessfulFalseAfterErrorsz9ReporterInterfaceTests.test_wasSuccessfulFalseAfterErrorss\ < E  9 9 ;<! < KK CLLN ; IIe   9 9 ;<$$ > KK " "499clln = >s>ABBN)r8r9r:r;rrzrrr IReporter__annotations__r\rrrrrrr<r,r)rrsH -5,=,=M4(()=P 8 7< <==r,rc@eZdZdZdZdZdZdZdZdZ dZ d Z y ) ReporterTestsz8 Tests for the base L{reporter.Reporter} class. crtj|d|_|j|j_yr)rr\_timerrr[r7s r)r\zReporterTests.setUps'$$T* #}} r,cD|xjdz c_|jSNr!)rr7s r)rzReporterTests._getTimes q {{r,c|jj|j|jj|j|j |jj dkD|j |jjd|j |jjdy)Nrr!T) r[rrstopTestrC _lastTimeretestsRunrHr7s r)test_startStopzReporterTests.test_startStops dii( TYY'  --12 --q1 224d;r,c|jt|j}|jd|j |jj d|jj d|jjd|jdd|j |jj dy) zE Test that the reporter safely writes to its stream. r%HellozHello rz Hello %s!Worldz Hello World! N)rr$r_writelnrertruncateseekrs r)test_brokenStreamzReporterTests.test_brokenStream!s##< +D#E  --/; Q  W- --/1ABr,c td}d}d}d}|jj|||||j|jj d|||j dd|fzy ) z L{reporter.Reporter} observes warnings emitted by the Twisted log system and writes them to its output stream. zsome warning textexceptions.RuntimeWarningzpath/to/some/file.pyGwarningcategoryfilenamelinenoz%s:%d: %s: %s rrN)RuntimeWarningrmsgrerrr)r(messagerrrs r) test_warningzReporterTests.test_warning-s} !!45.) h&    KK " 68>>#3Fr3JG T T r,cD|j|jy)zj A warning emitted twice within a single test is only written to the stream once. N)rr7s r)test_duplicateWarningSuppressedz-ReporterTests.test_duplicateWarningSuppressed>s  r,cF|jd}|jj||jj d|jj |j |jj d|jj |jj||jj||jj d|jj |j y)zn A warning emitted again after a new test has started is written to the stream again. test_warningEmittedForNewTestrN) __class__r[rrrrrrr(rs r)rz+ReporterTests.test_warningEmittedForNewTestIs ~~=> d#      T" d#   r,cF|jj|jjd|jj |j j tdddd|j|jjdy) zl L{reporter.Reporter} stops observing log events when its C{done} method is called. rz some messagerz file/name.pyrr@N) r[rrrrrrrrerr7s r)test_stopObservingz ReporterTests.test_stopObservingis}    ">20#  --/4r,N) r8r9r:r;r\rrrrrrrr<r,r)rr s1- < C " @5r,rceZdZdZy)SafeStreamTestsct}t|}tj|}|j d|j |j dy)z Test that L{reporter.SafeStream} successfully write to its original stream even if an interrupt happens during the write. rN)rr$r SafeStreamr/rer)r(rbrokensafes r) test_safezSafeStreamTests.test_safe{sH f%""6* 7 *G4r,N)r8r9r:rr<r,r)rrzs 5r,rceZdZUdZej Zeeje d<dZ dZ dZ dZdZdZd Zd Zd Zd Zd ZdZdZdZdZy)SubunitReporterTestszx Tests for the subunit reporter. This just tests that the subunit reporter implements the basic interface. rctj tdtjd|_t |_tj|_ |j|j|j|_ y)Nz2Subunit not installed, cannot test SubunitReporterrr) rTestProtocolClientrrr4rrrrrrrr[r7s r)r\zSubunitReporterTests.setUpsb  & & .OP PNN:. i ))+(((O r,c6t}tj|}t|||i|}|j }t|j ||i|}|j |||j ||jj y)a Assert that 'methodName' on L{SubunitReporter} forwards to the equivalent method on subunit. Checks that the return value from subunit is returned from the L{SubunitReporter} and that the reporter writes the same data to its stream as subunit does to its own. Assumes that the method on subunit has the same name as the method on L{SubunitReporter}. N)rrrgetattrrr[rer) r( methodNameargskwargsr subunitClient subunitReturn subunitOutputreporterReturns r)assertForwardsToSubunitz,SubunitReporterTests.assertForwardsToSubunits 33F; : z:DKFK ) 9j94J6J 7  (<(<(>?r,ct||d}|yt|D]'} t|||jt|||)y#t t f$rYywxYw)a Remove 'methodName' from 'klass'. If 'klass' does not have a method named 'methodName', then 'removeMethod' succeeds silently. If 'klass' does have a method named 'methodName', then it is removed using delattr. Also, methods of the same name are removed from all base classes of 'klass', thus removing the method entirely. @param klass: The class to remove the method from. @param methodName: The name of the method to remove. N)rrdelattr addCleanupsetattrAttributeErrorrO)r(klassrmethodbases r) removeMethodz!SubunitReporterTests.removeMethodsl D1 > 5M CD Cj)z6B  C#I.  s AAAc"|jtjd ddz |jj}|jjd|jjd|jj|j |jj}|j||y#t$r<|jj |j tjdYwxYw)z Some versions of subunit don't have "addExpectedFailure". For these versions, we report expected failures as successes. rkr!rroN)rrrrr[rkrrbrcrrrrrre)r(expectedFailureOutput successOutputs r).test_subunitWithoutAddExpectedFailureInstalledzCSubunitReporterTests.test_subunitWithoutAddExpectedFailureInstalleds (557KL N E!% 4 4 6 Q  tyy) ,,.  (=>! N KK * *499cllnf M NsC AD Dc|jtjd|jj |j d|j j}|j jd|j jd|jj|j |j j}|j||y)zz Some versions of subunit don't have "addSkip". For these versions, we report skips as successes. rEreasonrN) rrrr[rErrrrrrre)r( skipOutputrs r)#test_subunitWithoutAddSkipInstalledz8SubunitReporterTests.test_subunitWithoutAddSkipInstalleds (55yA DIIx0[[))+  Q  tyy) ,,.   3r,c(gfd}||jj_ ddz |j|j fgy#t$r>t j }|jj|j |dYfwxYw)z Some versions of subunit have "addExpectedFailure". For these versions, when we call 'addExpectedFailure' on the test result, we pass the error and test through to the subunit client. c,j||fyr&r)rraddExpectedFailureCallss r)rkzUSubunitReporterTests.test_addExpectedFailurePassedThrough..addExpectedFailures # * *D%= 9r,r!rroN)r[_subunitrkrrbrcrre)r(rkrcr#s @r)$test_addExpectedFailurePassedThroughz9SubunitReporterTests.test_addExpectedFailurePassedThroughs #% : 3E / H E 0DIIx3H2IJ! H||~H KK * *499h G HsA ABBcgfd}||jj_|jj|jd|j |jdfgy)z Some versions of subunit have "addSkip". For these versions, when we call 'addSkip' on the test result, we pass the test and reason through to the subunit client. c,j||fyr&r")rr addSkipCallss r)rEzESubunitReporterTests.test_addSkipSendsSubunitAddSkip..addSkips   v /r,rN)r[r$rErre)r(rEr(s @r)test_addSkipSendsSubunitAddSkipz4SubunitReporterTests.test_addSkipSendsSubunitAddSkipsW   0 (/ $ DIIx0 H(='>?r,c|jj|jd|jj y)z The subunit reporter doesn't need to print out a summary -- the stream of results is everything. Thus, done() does nothing. r,N)r[rrerrr7s r)test_doneDoesNothingz)SubunitReporterTests.test_doneDoesNothing s1  dkk2245r,c<|jd|jy)zT SubunitReporter.startTest() sends the subunit 'startTest' message. rNrrr7s r)#test_startTestSendsSubunitStartTestz8SubunitReporterTests.test_startTestSendsSubunitStartTests $$[$))?r,ctjjd}|j|j|j j }|jd|y)zC Load-time errors are reported like normal errors. doesntexists doesntexistN)rrrrr[rrassertIn)r(rrQs r)test_loadTimeErrorsz(SubunitReporterTests.test_loadTimeErrorsFsO  "--m< %%' nf-r,N)r8r9r:r;rSubunitReporterrrrrrr\rrrrr%r)r+r.r0r2r4r7r9r=r<r,r)rrsw -5,D,DM4(()DP@*C2?" 4K*@"6= < > CG @ .r,rceZdZdZdZy) SubunitReporterNotInstalledTestszD Test behaviour when the subunit reporter is not installed. ct}|jtdd|jttj |}|j dt|y)z If subunit is not installed, TestProtocolClient will be None, and SubunitReporter will raise an error when you try to construct it. rNzSubunit not available)rpatchrrsrtr>rerK)r(rrhs r)test_subunitNotInstalledz9SubunitReporterNotInstalledTests.test_subunitNotInstalledWsK  8148   i)A)A6 J 0#a&9r,N)r8r9r:r;rCr<r,r)r@r@Rs :r,r@cJeZdZUejZeeje d<y)TimingReporterTestsrN) r8r9r:rTimingTextReporterrrrrrr<r,r)rErEbs,4,G,GM4(()Gr,rEcDeZdZdZdZdZd dZdZdZd dZ d Z d Z y) LoggingReporterzJ Simple reporter that stores the last test that was passed to it. cXtjj|g|i|d|_yr&)rrzr*r)r(rr s r)r*zLoggingReporter.__init__ks'""49$9&9 r,c||_yr&r)r(rrs r)razLoggingReporter.addErroror+r,Nc||_yr&rK)r(rrjros r)rkz"LoggingReporter.addExpectedFailurerr+r,c||_yr&rK)r(rrjs r)rnzLoggingReporter.addFailureur+r,c||_yr&rK)r(rskips r)rEzLoggingReporter.addSkipxr+r,c||_yr&rKrvs r)rsz$LoggingReporter.addUnexpectedSuccess{r+r,c||_yr&rKrs r)rzLoggingReporter.startTest~r+r,c||_yr&rKrs r)rzLoggingReporter.stopTestr+r,r&) r8r9r:r;r*rarkrnrErsrrr<r,r)rHrHfs/r,rHcdeZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZdZdZy)AdaptedReporterTestsz L{reporter._AdaptedReporter} is a reporter wrapper that wraps all of the tests it receives before passing them on to the original reporter. c.|j|_yr&)getWrappedResult wrappedResultr7s r)r\zAdaptedReporterTests.setUps!224r,c"|jSr&)r6rs r) _testAdapterz!AdaptedReporterTests._testAdapterswwyr,cn|j|jj|j|yr&)rer-rrY)r(rWrs r) assertWrappedz"AdaptedReporterTests.assertWrappeds* 88==t?P?PQU?VWr,c: |#t$r tcYSwxYw)z Return a L{Failure} from raising the given exception. @param exceptionInstance: The exception to raise. @return: L{Failure} ) BaseExceptionr)r(exceptionInstances r) getFailurezAdaptedReporterTests.getFailures$ # # 9  s cVt}tj||jSr&)rHr_AdaptedReporterrYrs r)rVz%AdaptedReporterTests.getWrappedResults# "((1B1BCCr,c|jj||jt|j |j|y)zG C{addError} wraps its test with the provided adapter. N)rWrar_r`r[r7s r) test_addErrorz"AdaptedReporterTests.test_addErrors; ##D$//,.*IJ 4--t4r,c|jj||jt|j |j|y)zI C{addFailure} wraps its test with the provided adapter. N)rWrnr_AssertionErrorr[r7s r)test_addFailurez$AdaptedReporterTests.test_addFailures< %%dDOON ""4+9N)OP 4--t4r,cr|jj||j|j|y)zH C{startTest} wraps its test with the provided adapter. N)rWrr[r7s r)test_startTestz#AdaptedReporterTests.test_startTests. $$T* 4--t4r,cr|jj||j|j|y)zG C{stopTest} wraps its test with the provided adapter. N)rWrr[r7s r) test_stopTestz"AdaptedReporterTests.test_stopTests. ##D) 4--t4r,c|jj||jtt d|j |j|y)zQ C{addExpectedFailure} wraps its test with the provided adapter. rhN)rWrkr_r`rr[r7s r)test_addExpectedFailurez,AdaptedReporterTests.test_addExpectedFailuresG -- $//,.14 3D  4--t4r,c|jj||jt|j |j|y)z@ C{addExpectedFailure} works without a C{Todo}. N)rWrkr_r`r[r7s r)test_expectedFailureWithoutTodoz4AdaptedReporterTests.test_expectedFailureWithoutTodos; --dDOOLN4ST 4--t4r,c|jj|td|j|j|y)zS C{addUnexpectedSuccess} wraps its test with the provided adapter. rhN)rWrsrr[r7s r)test_addUnexpectedSuccessz.AdaptedReporterTests.test_addUnexpectedSuccesss5 //d;6GH 4--t4r,cr|jj||j|j|y)zB C{addUnexpectedSuccess} works without a C{Todo}. N)rWrsr[r7s r)!test_unexpectedSuccessWithoutTodoz6AdaptedReporterTests.test_unexpectedSuccessWithoutTodos. //5 4--t4r,N)r8r9r:r;r\rYr[r_rVrcrfrirkrmrorqrsrur<r,r)rTrTsO 5X D555555555r,rTceZdZdZddZdZy) FakeStreamz A fake stream which C{isatty} method returns some predictable. @ivar tty: returned value of C{isatty}. @type tty: C{bool} c||_yr&tty)r(rzs r)r*zFakeStream.__init__s r,c|jSr&ryr7s r)isattyzFakeStream.isattys xxr,N)T)r8r9r:r;r*r|r<r,r)rwrwsr,rwc@eZdZdZdZdZdZdZdZdZ dZ d Z y ) AnsiColorizerTestsz/ Tests for L{reporter._AnsiColorizer}. cJtjj|_yr&)rbmodulescopy savedModulesr7s r)r\zAnsiColorizerTests.setUpsKK,,.r,ctjjtjj|jyr&)rbrclearupdaterr7s r)tearDownzAnsiColorizerTests.tearDowns*  4,,-r,cr|jtjjt dy)zq L{reporter._AnsiColorizer.supported} returns C{False} if the given stream is not a TTY. FN) assertFalser_AnsiColorizer supportedrwr7s r)test_supportedStdOutTTYz*AnsiColorizerTests.test_supportedStdOutTTYs( 00:::e;LMNr,cdtjd<|jtjj t y)zw L{reporter._AnsiColorizer.supported} returns C{False} if the curses module can't be imported. Ncursesrbrrrrrrwr7s r)test_supportedNoCursesz)AnsiColorizerTests.test_supportedNoCursess3 !% H 00:::<HIr,czGdd}|tjd<|jtjj t |jtjj t |jtjdjdy)a L{reporter._AnsiColorizer.supported} returns C{True} if C{curses.tigetnum} returns more than 2 supported colors. It only tries to call C{curses.setupterm} if C{curses.tigetnum} previously failed with a C{curses.error}. c eZdZeZdZdZdZy)>AnsiColorizerTests.test_supportedSetupTerm..fakecursesrc.|xjdz c_yrr\r7s r) setuptermzHAnsiColorizerTests.test_supportedSetupTerm..fakecurses.setupterm a r,c<|jry|j)NrQ)r\rr(rfs r)tigetnumzGAnsiColorizerTests.test_supportedSetupTerm..fakecurses.tigetnums::**,&r,Nr8r9r:r`rr\rrr<r,r) fakecursesrs EE  'r,rrr!N) rbrrCrrrrwrer\r(rs r)test_supportedSetupTermz*AnsiColorizerTests.test_supportedSetupTerms{ ' '!+  H //99*,GH //99*,GH X.44a8r,cGdd}|tjd<|jtjj t y)z L{reporter._AnsiColorizer.supported} returns C{False} and doesn't try to call C{curses.setupterm} if C{curses.tigetnum} returns something different than C{curses.error}. ceZdZeZdZy)GAnsiColorizerTests.test_supportedTigetNumWrongError..fakecursesctr&) ValueErrorrs r)rzPAnsiColorizerTests.test_supportedTigetNumWrongError..fakecurses.tigetnum5s  l"r,Nr8r9r:r`rrr<r,r)rr2s  E #r,rrNrrs r) test_supportedTigetNumWrongErrorz3AnsiColorizerTests.test_supportedTigetNumWrongError+s? # # !+  H 00:::<HIr,cGdd}|tjd<|jtjj t y)z L{reporter._AnsiColorizer.supported} returns C{False} if C{curses.tigetnum} returns less than 2 supported colors. ceZdZeZdZy)KAnsiColorizerTests.test_supportedTigetNumNotEnoughColor..fakecursescyrr<rs r)rzTAnsiColorizerTests.test_supportedTigetNumNotEnoughColor..fakecurses.tigetnumDsr,Nrr<r,r)rrAs  E r,rrNrrs r)$test_supportedTigetNumNotEnoughColorz7AnsiColorizerTests.test_supportedTigetNumNotEnoughColor;s?    !+  H 00:::<HIr,cGdd}|tjd<|jtjj t |jtjdjdy)z L{reporter._AnsiColorizer.supported} returns C{False} if C{curses.tigetnum} raises an error, and calls C{curses.setupterm} once. c eZdZeZdZdZdZy)CAnsiColorizerTests.test_supportedTigetNumErrors..fakecursesrc.|xjdz c_yrrr7s r)rzMAnsiColorizerTests.test_supportedTigetNumErrors..fakecurses.setuptermTrr,c"|jr&)rrs r)rzLAnsiColorizerTests.test_supportedTigetNumErrors..fakecurses.tigetnumWsjjl"r,Nrr<r,r)rrPs EE  #r,rrr!N) rbrrrrrrwrer\rs r)test_supportedTigetNumErrorsz/AnsiColorizerTests.test_supportedTigetNumErrorsJs^  # #!+  H 00:::<HI X.44a8r,N) r8r9r:r;r\rrrrrrrr<r,r)r~r~s3/.OJ96J J9r,r~c(eZdZdZdZdZdZdZy)ExitWrapperTestsz- Tests for L{reporter._ExitWrapper}. cttd|_tjd|_t j|_t|j|_ |j|jjy)NzI am a Failurer) rrtrjrr4rrrZr[rwrappedrrr7s r)r\zExitWrapperTests.setUpds\y)9:; NN:. ))+ #DKK0  001r,c(|jj|j|j|j |jj |j |jj|j|jfgy)zm L{reporter._ExitWrapper} causes a wrapped reporter to stop after its first failure. N) rrnrrjrCrrer[ror7s r)test_stopOnFailurez#ExitWrapperTests.test_stopOnFailureks`  4<<8  //0 --DLL0I/JKr,c(|jj|j|j|j |jj |j |jj|j|jfgy)zk L{reporter._ExitWrapper} causes a wrapped reporter to stop after its first error. N) rrarrjrCrrer[rdr7s r)test_stopOnErrorz!ExitWrapperTests.test_stopOnErrorts` dii6  //0 ++tyy$,,.G-HIr,c(|jj|j|j|j |jj |j |jj|j|jfgy)zy L{reporter._ExitWrapper} does not cause a wrapped reporter to stop after an unexpected success. N) rrsrrjrrrer[rgr7s r)#test_doesNotStopOnUnexpectedSuccessz4ExitWrapperTests.test_doesNotStopOnUnexpectedSuccess}sb ))$))T\\B 001 88DIIt||;T:UVr,N)r8r9r:r;r\rrrr<r,r)rr_s2LJWr,r)Nr;r1rrFrbinspectriorrtypingrrrrrrr hamcrestr r r r twisted.pythonrtwisted.python.failurer twisted.trialrrrrtwisted.trial.reporterrrrrrtwisted.trial.unittestrrr_dist.test.matchersrrr matchersr"r$SynchronousTestCaser>rXrwr}rrrrrr2r<r\rarrrrrrrr@rErzrHrTrwr~rr<r,r)rs4    A@*BBO0;;II882N--N4)Kh22)KX?O? z *z z/B"JWX99JWZ.0*.0b?Ax33?ADF 44F R-h22-:E-,,E-P3i3$[L,,[L|^5877^5B  g955g9T%Wx33%Wr,