Your IP : 172.28.240.42


Current Path : /usr/lib/python2.7/dist-packages/twisted/trial/test/
Upload File :
Current File : //usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyc


WqNc@sddlZddlZddlZddlmZddlmZddlmZm	Z	ddl
mZmZm
Z
mZddlmZmZmZmZddlmZddlmZdd	lmZdd
lmZddlmZedZd
e fdYZ!de fdYZ"dd9dYZ#de#ej$fdYZ%de#ej$fdYZ&de fdYZ'de'ej$fdYZ(de'ej$fdYZ)dej$fdYZ*dej$fd YZ+d!ej$fd"YZ,d#ej$fd$YZ-d%e-fd&YZ.d'ej/fd(YZ0d)ej$fd*YZ1d+ej$fd,YZ2d-e fd.YZ3d/e3e2fd0YZ4d1e3e2fd2YZ5d3ej$fd4YZ6d5ej$fd6YZ7d7ej$fd8YZ8dS(:iN(t
implements(tverifyObject(t	IReportert	ITestCase(tunittesttrunnertreportertutil(tfailuretlogtreflecttfilepath(tFilePath(ttrial(t
twisted_trial(tplugin(tdeferRtCapturingDebuggercBseZdZdZRS(cCs
g|_dS(N(t_calls(tself((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyt__init__scOs)|jjd|d|d|dS(Ntruncallii(Rtappend(Rtargstkwargs((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyRs(t__name__t
__module__RR(((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyRs	tCapturingReportercBsxeZdZeedZdZdZdZ	dZ
dddddZdZdZ
dZdZdZRS(sC
    Reporter that keeps a log of all actions performed on it.
    cCs:g|_t|_||_||_||_||_dS(s.
        Create a capturing reporter.
        N(RtFalset
shouldStopt_streamt	_tbformatt	_rterrorst
_publisher(Rtstreamttbformattrterrorst	publisher((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyR1s					cCs|jjddS(s
        Report the beginning of a run of a single test method
        @param method: an object that is adaptable to ITestMethod
        t	startTestN(RR(Rtmethod((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyR&>scCs|jjddS(s}
        Report the status of a single test method
        @param method: an object that is adaptable to ITestMethod
        tstopTestN(RR(RR'((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyR(FscCs|jjddS(scalled when the reactor has been left in a 'dirty' state
        @param errs: a list of L{twisted.python.failure.Failure}s
        tcleanupErrorN(RR(Rterrs((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyt
cleanupErrorsNscCs|jjddS(Nt
addSuccess(RR(Rttest((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyR,UscCsdS(s@
        Do nothing. These tests don't care about done.
        N((R((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pytdoneYsN(RRt__doc__RRtNoneR"R#Rt	separatorttestsRunRR&R(R+R,R.(((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyR$s
					tTrialRunnerTestsMixincBsDeZdZdZdZdZdZdZdZRS(s9
    Mixin defining tests for L{runner.TrialRunner}.
    cCs|jjdS(N(Rt_tearDownLogFile(R((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyttearDowndscCsdS(s=
        Empty test method, used by the other tests.
        N((R((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyt
test_emptyhscCs
tjjS(N(R	ttheLogPublishert	observers(R((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyt
_getObserversnscCsKt|j}|jj|jt|j}|j||dS(sn
        Any log system observers L{TrialRunner.run} adds are removed by the
        time it returns.
        N(tlenR9RtrunR-tassertEqual(Rt
originalCounttnewCount((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyttest_addObserversrscsjjgfd}|j_jjjjjjjtdjddkddS(s=
        Test that a new file is opened on each run.
        csjjjdS(N(RRt_logFileObserver((toldSetUpLogFileRtl(sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pytsetUpLogFilesiiis'Should have created a new file observerN(Rt
_setUpLogFileR;R-R<R:tfailIf(RRC((RARRBsB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyttest_logFileAlwaysActive}scstjjgfd}|j_jjjjtdjdjdS(sB
        Test that file created is closed during the run.
        csjjjdS(N(RRt_logFileObject((RARRB(sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyRCsiiN(RRDR;R-R<R:t
failUnlesstclosed(RRC((RARRBsB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyttest_logFileGetsCloseds(	RRR/R5R6R9R?RFRJ(((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyR3`s					tTestTrialRunnercBs eZdZdZdZRS(sm
    Tests for L{runner.TrialRunner} with the feature to turn unclean errors
    into warnings disabled.
    cCs=tj|_tjtd|j|_td|_dS(NR"R6(tStringIOR"RtTrialRunnerRRKR-(R((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pytsetUpscCs&|jj}|j|jtdS(s
        The reporter constructed by L{runner.TrialRunner} is passed
        L{twisted.python.log} as the value for the C{publisher} parameter.
        N(Rt_makeResulttassertIdenticalR!R	(Rtresult((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyttest_publishers(RRR/RNRR(((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyRKs	t&TrialRunnerWithUncleanWarningsReportercBseZdZdZRS(sa
    Tests for the TrialRunner's interaction with an unclean-error suppressing
    reporter.
    cCsCtj|_tjtd|jdt|_td|_dS(NR"tuncleanWarningsR6(RLR"RRMRtTrueRKR-(R((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyRNs(RRR/RN(((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyRSstDryRunMixincBsPeZejdeddgZdZdZdZdZdZ	RS(tcategorytmessages'Test visitors deprecated in Twisted 8.0cCsJg|_tj|_tjttjjd|j|_|jdS(NR"(R	RLR"RRMRtDRY_RUNtmakeTestFixtures(R((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyRNs		cCsdS(sh
        Set C{self.test} and C{self.suite}, where C{self.suite} is an empty
        TestSuite.
        N((R((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyRZscCs/|jjtj}|j|jgdS(sf
        If there are no tests, the reporter should not receive any events to
        report.
        N(RR;t	TestSuiteR<R(RRQ((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyR6scCs5|jj|j}|j|jdddgdS(s
        If we are running a single test, check the reporter starts, passes and
        then stops the test during a dry run.
        R&R,R(N(RR;R-R<R(RRQ((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyttest_singleCaseReportingscCs*|jj|j|j|jgdS(sT
        When we are doing a dry run, the tests should not actually be run.
        N(RR;R-R<R	(R((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyttest_testsNotRuns(
RRRtsuppresstDeprecationWarningRNRZR6R\R](((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyRVs								t
DryRunTestcBseZdZdZRS(s@
    Check that 'dry run' mode works well with Trial tests.
    csAdtjffdY}|d_tj_dS(NtMockTestcseZfdZRS(csjjddS(Nttest_foo(R	R(R-(R(sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyRbs(RRRb((R(sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyRasRb(RtTestCaseR-RR[tsuite(RRa((RsB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyRZs(RRR/RZ(((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyR`stPyUnitDryRunTestcBseZdZdZRS(sJ
    Check that 'dry run' mode works well with stdlib unittest tests.
    cCs;dtjfdY}|d|_tj|_dS(Nt
PyunitCasecBseZdZRS(cSsdS(N((R((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyRbs(RRRb(((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyRfsRb(tpyunitRcR-R[Rd(RRf((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyRZs(RRR/RZ(((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyRest
TestRunnercBs}eZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZRS(
cstj_tjtjd}dj|d }|d}tj	d|ddddddd	|gfd
}tj_
|t_ddd
ddd
ddd
ddd
ddd
ddd
ddd
ddd
ddd
ddd
g_dS(Nt.isTest Helper ReportertdescriptionsUtility for unit testing.tlongOptt	capturingtshortOpttklasscs-j|ttj|||S(N(R<Rtlisttoriginal(tifacetatkw(Rtplugins(sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyt
getPlugins!sR&R,R((R
tOptionstconfigR
tqualRtsplittjoinRt	_ReporterR0RRuRptstandardReport(RtpartstpackageRnRu((RRtsB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyRNs0
										cCs|jt_dS(N(RpRRu(R((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyR54scCs|jj|dS(N(RwtparseOptions(RR((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyR8scCsDtj|j}tj|_|j|jtj|_	|S(N(
R
t_makeRunnerRwRLR"t
addCleanupR4R	tLogPublishert_log(Rtr((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyt	getRunner<s
cCsC|jg|jd}|j}|j||jjdS(NR(RRwRR<ROt	__class__(RRQR((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyttest_runner_can_get_reporterMs

cCsC|jg|j}|j}|j|j|jddS(NR(RRROR<RRw(RRRQ((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyttest_runner_get_resultTs
cCs6|jg|j}|j|jtjdS(s
        By default Trial sets the 'uncleanWarnings' option on the runner to
        False. This means that dirty reactor errors will be reported as
        errors. See L{test_reporter.TestDirtyReactor}.
        N(RRtassertNotIsInstanceRORtUncleanWarningsReporterWrapper(RR((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyt test_uncleanWarningsOffByDefault[s
cCs9|jdg|j}|j|jtjdS(s
        Specifying '--unclean-warnings' on the trial command line will cause
        reporters to be wrapped in a device which converts unclean errors to
        warnings.  See L{test_reporter.TestDirtyReactor} for implications.
        s--unclean-warningsN(RRtassertIsInstanceRORR(RR((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyttest_getsUncleanWarningsgscCs6|jddg|j}|j|jddS(Ns--temp-directoryt	some_path(RRR<tworkingDirectory(RR((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyttest_runner_working_directorysscs|jg|jtjtjt|jjtjj|j	}|j	idt
jffdY|jd}|j
|j}|r|j|ddn|jijdjd6jdjd	6d
S(s
        If no working directory is explicitly specified and the default
        working directory is in use by another runner, L{TrialRunner.run}
        selects a different default working directory to use.
        tConcurrentCasecs/eZfdZfdZRS(csNtjd<}tjj|jtj|jddS(s
                Start a second test run which will have a default working
                directory which is the same as the working directory of the
                test run already in progress.
                t
concurrentttest_secondN(tostgetcwdtchdirtpathRR;(RtsubsequentDirectory(trunDirectorytwhereRtsecondRunner(sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyt
test_firstscstjd<dS(sR
                Record the working directory for later analysis.
                trecordN(RR(R(R(sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyRs(RRRR((RRRR(sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyRsRiit_trial_tempRs
_trial_temp-1RN(RRRRRRtmktemptmakedirsRRRRcR;terrorstfailurestfailR<tchild(RtfirstRunnerRQtbad((RRRRsB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyt'test_concurrentImplicitWorkingDirectoryys"

(cs|jdtjj|jgtj}|jtj||j}|jdt	j
ffdY|jd}|j|j
}|r|j|ddndS(s
        If a working directory which is already in use is explicitly specified,
        L{TrialRunner.run} raises L{_WorkingDirectoryBusy}.
        s--temp-directoryRcs#eZfdZdZRS(cs#|jtjjddS(s
                Try to start another runner in the same working directory and
                assert that it raises L{_WorkingDirectoryBusy}.
                ttest_failureN(tassertRaisesRt_WorkingDirectoryBusyR;(R(RR(sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyttest_concurrentscSs|jddS(sE
                Should not be called, always fails.
                s$test_failure should never be called.N(R(R((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyRs(RRRR((RR(sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyRs	RiiN(RRRtabspathRRRRRRRcR;RRR(RtinitialDirectoryRRQR((RRsB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyt'test_concurrentExplicitWorkingDirectorys%"cCsu|jd|jdddg|j}tj}|jdt}|j|}|j|j	|j
dS(Ns--temp-directorys
--reporterRlstwisted.trial.test.sample(RRRRt
TestLoadert
loadByNameRUR;R<R|R(Rt	my_runnertloaderRdRQ((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyttest_runner_normals
cs|jddddg|j}tfd}||_tj}|jdt}|j|}|j	|j
|j|j	dgjdS(Ns
--reporterRls--debugstwisted.trial.test.samplecsS(N(((tdebugger(sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pytget_debuggersR(RRRt_getDebuggerRRRRUR;R<R|R(RRRRRdRQ((RsB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyttest_runner_debugs
		(RRRNR5RRRRRRRRRRR(((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyRh
s	&									7	#	tRemoveSafelyTestscBs)eZdZdZdZdZRS(s%
    Tests for L{_removeSafely}.
    cCsE|j}tj|tj|}|jtjtj|dS(s
        If a path doesn't contain a node named C{"_trial_marker"}, that path is
        not removed by L{runner._removeSafely} and a L{runner._NoTrialMarker}
        exception is raised instead.
        N(	RRtmkdirRRRRt_NoTrialMarkert
_removeSafely(Rt	directorytdirPath((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyttest_removeSafelyNoTrialMarkers
cCsd}tj}|jtd||j}tj|tj|}|jdj	||_
tj||j
d|jdS(s
        If an L{OSError} is raised while removing a path in
        L{runner._removeSafely}, an attempt is made to move the path to a new
        name.
        cSs
tdS(s
            Raise an C{OSError} to emulate the branch of L{runner._removeSafely}
            in which path removal fails.
            N(tOSError(((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pytdummyRemoveststdoutt
_trial_markerscould not remove FilePathN(RLtpatchtsysRRRRRRttouchtremoveRRtassertIntgetvalue(RRtoutRR((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyt(test_removeSafelyRemoveFailsMoveSucceedss	
	
cCsd}d}tj}|jtd||j}tj|tj|}|jdj	||_
||_|jt
tj|}|jt|d|jd|jdS(s
        If an L{OSError} is raised while removing a path in
        L{runner._removeSafely}, an attempt is made to move the path to a new
        name. If that attempt fails, the L{OSError} is re-raised.
        cSstddS(s
            Raise an C{OSError} to emulate the branch of L{runner._removeSafely}
            in which path removal fails.
            spath removal failedN(R(((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyR!scSstddS(s
            Raise an C{OSError} to emulate the branch of L{runner._removeSafely}
            in which path movement fails.
            spath movement failedN(R(R((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pytdummyMoveTo(sRRspath movement failedscould not remove FilePathN(RLRRRRRRRRRRtmoveToRRRRR<tstrRR(RRRRRRterror((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyt%test_removeSafelyRemoveFailsMoveFailss		
		(RRR/RRR(((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyRs		tTestTrialSuitecBseZdZRS(cCsddlm}dS(Ni(t
TrialSuite(ttwisted.trial.runnerR(RR((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyttest_importsEs(RRR(((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyRCstTestUntilFailurecBsNeZdejfdYZdZdZdZdZdZ	RS(t	FailAftercBseZdZgZdZRS(sD
        A test  case that fails when run 3 times in a row.
        cCs9|jjdt|jdkr5|jdndS(NisCount reached 3(tcountRR0R:R(R((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyRbRs(RRR/RRb(((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyRMscCsOgtj_tjd|_tj|_tjtj	d|j|_dS(NRbR"(
RRRR-RLR"RRMRtReporter(R((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyRNXscCsX|jj|j}|j|jd|j|j|j|j|ddS(sl
        Test that the runUntilFailure method of the runner actually fail after
        a few runs.
        iN(RtrunUntilFailureR-R<R2REt
wasSuccessfult_getFailures(RRQ((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyttest_runUntilFailure_scCs
t|jS(sL
        Get the number of failures that were reported to a result.
        (R:R(RRQ((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyRjscsgfd}|jtd||jj|j}|j|jd|jtd|j|jtfgdS(s
        C{runUntilFailure} doesn't decorate the tests uselessly: it does it one
        time when run starts, but not at each turn.
        csj||f|S(N(R(R-t	interface(t	decorated(sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pytdecoratewsRiN(	RRRRR-R<R2R:R(RRRQ((RsB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyttest_runUntilFailureDecorateqscsgfd}|jtd|t|j_|jj|j}|j|jd|jt	d|j|jt
f|jtjfgdS(s
        C{runUntilFailure} applies the force-gc decoration after the standard
        L{ITestCase} decoration, but only one time.
        csj||f|S(N(R(R-R(R(sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyRsRiiN(RRRURt_forceGarbageCollectionRR-R<R2R:Rt _ForceGarbageCollectionDecorator(RRRQ((RsB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyt#test_runUntilFailureForceGCDecorates	(
RRRRcRRNRRRR(((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyRLs				tUncleanUntilFailureTestscBs eZdZdZdZRS(sh
    Test that the run-until-failure feature works correctly with the unclean
    error suppressor.
    cCs5tj|tjtjd|jdt|_dS(NR"RT(RRNRRMRRR"RU(R((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyRNs
cCst|jjS(s
        Get the number of failures that were reported to a result that
        is wrapped in an UncleanFailureWrapper.
        (R:t_originalReporterR(RRQ((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyRs(RRR/RNR(((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyRs	t
BreakingSuitecBseZdZdZRS(s;
    A L{TestSuite} that logs an error when it is run.
    cCs;ytdWn$tk
r6tjtjnXdS(Ns#error that occurs outside of a test(tRuntimeErrorR	terrRtFailure(RRQ((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyR;s
(RRR/R;(((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyRstTestLoggedErrorscBs)eZdZdZdZdZRS(s

    It is possible for an error generated by a test to be logged I{outside} of
    any test. The log observers constructed by L{TestCase} won't catch these
    errors. Here we try to generate such errors and ensure they are reported to
    a L{TestResult} object.
    cCs|jtdS(N(tflushLoggedErrorsR(R((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyR5scCs&tj}|j|jddS(sg
        Check that we can construct a L{runner.LoggedSuite} and that it
        starts empty.
        iN(RtLoggedSuiteR<tcountTestCases(RRd((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyttest_constructscCstj}tjtg}|j||jt|jd|j|jddj	tj
|j|jddjt
dS(sU
        Chek that a L{LoggedSuite} reports any logged errors to its result.
        iiN(Rt
TestResultRRRR;R<R:RtidtNOT_IN_TESTRHtcheckR(RRQRd((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyttest_capturesErrors
$(RRR/R5RR(((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyRs			tTestTestHoldercBs,eZdZdZdZdZRS(cCs"d|_tj|j|_dS(NRj(RjRt
TestHoldertholder(R((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyRNs	cCs<|j|jj|j|j|jj|jdS(s
        Check that L{runner.TestHolder} takes a description as a parameter
        and that this description is returned by the C{id} and
        C{shortDescription} methods.
        N(R<RRRjtshortDescription(R((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyttest_holderscCsI|j|jt|j|jtt|jd|jtfdS(s?
        L{runner.TestHolder} implements L{ITestCase}.
        s5%r claims to provide %r but does not do so correctly.N(RPRRt
assertTrueR(R((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyttest_holderImplementsITestCases
cCsFtj}|jj||j|j|jd|jdS(sc
        A L{runner.TestHolder} can run against the standard Python
        C{TestResult}.
        iN(RgRRR;RRR<R2(RRQ((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyttest_runsWithStandardResults(RRRNRRR(((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyRs		
	tErrorHolderTestsMixincBs]eZdZedZdefdYZdZdZdZ	dZ
dZRS(	sa
    This mixin defines test methods which can be applied to a
    L{runner.ErrorHolder} constructed with either a L{Failure} or a
    C{exc_info}-style tuple.

    Subclass this and implement C{setUp} to create C{self.holder} referring to a
    L{runner.ErrorHolder} instance and C{self.error} referring to a L{Failure}
    which the holder holds.
    s"integer division or modulo by zerotTestResultStubcBs2eZdZdZdZdZdZRS(s)
        Stub for L{TestResult}.
        cCs
g|_dS(N(R(R((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyRscCsdS(N((RR-((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyR&scCsdS(N((RR-((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyR(scCs|jj||fdS(N(RR(RR-R((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pytaddErrors(RRR/RR&R(R(((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyRs
			cCsFtj}|jj||j|j|jd|jdS(sd
        A L{runner.ErrorHolder} can run against the standard Python
        C{TestResult}.
        iN(RgRRR;tassertFalseRR<R2(RRQ((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyRscCsT|jj|j|j|jj|j|jj|jj|jjffgdS(sM
        L{runner.ErrorHolder} adds an error to the result when run.
        N(	RR;RQR<RRttypetvaluettb(R((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyttest_run*s	cCsQ|j|j|j|jj|j|jj|jj|jjffgdS(sP
        L{runner.ErrorHolder} adds an error to the result when called.
        N(RRQR<RRRRR(R((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyt	test_call4s	cCs|j|jjddS(sH
        L{runner.ErrorHolder.countTestCases} always returns 0.
        iN(R<RR(R((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyttest_countTestCases>scCs|jt|jddS(sh
        L{runner.ErrorHolder.__repr__} returns a string describing the error it
        holds.
        sf<ErrorHolder description='description' error=ZeroDivisionError('integer division or modulo by zero',)>N(R<treprR(R((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyt	test_reprEs(RRR/tZeroDivisionErrortexceptionForTeststobjectRRRRRR(((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyRs			
	
	tFailureHoldingErrorHolderTestscBseZdZdZRS(s
    Tests for L{runner.ErrorHolder} behaving similarly to L{runner.TestHolder}
    when constructed with a L{Failure} representing its error.
    cCsgd|_y
|jWn tk
r8tj|_nXtj|j|j|_|j	|_
dS(NRj(RjRRRRRRtErrorHolderRRRQ(R((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyRNUs	

(RRR/RN(((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyR
PstExcInfoHoldingErrorHolderTestscBseZdZdZRS(s
    Tests for L{runner.ErrorHolder} behaving similarly to L{runner.TestHolder}
    when constructed with a C{exc_info}-style tuple representing its error.
    cCspd|_y
|jWn,tk
rDtj}tj|_nXtj	|j||_
|j|_dS(NRj(
RjRRRtexc_infoRRRRRRRRQ(Rt
exceptionInfo((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyRNfs	

(RRR/RN(((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyRastTestMalformedMethodcBsKeZdZdejfdYZdZdZdZdZ	RS(sR
    Test that trial manages when test methods don't have correct signatures.
    tContainMalformedcBs/eZdZdZdZejeZRS(sV
        This TestCase holds malformed test methods that trial should handle.
        cCsdS(N((Rtblah((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyRb{scCsdS(N((((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyttest_bar}s(RRR/RbRRtdeferredGeneratort	test_spam(((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyRws		cCstj}tjtjd|}tj|}|j|}|j|j	d|j
|j|jt|j
ddS(sL
        Wrapper for one of the test method of L{ContainMalformed}.
        R"iN(RLRRMRRRRR;R<R2RERR:R(RR'R"ttrialRunnerR-RQ((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyt_testscCs|jddS(sE
        Test when the method has extra (useless) arguments.
        RbN(R(R((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyt
test_extraArgscCs|jddS(sJ
        Test when the method doesn't have even self as argument.
        RN(R(R((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyt
test_noArgscCs|jddS(s5
        Test a decorated method also fails.
        RN(R(R((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyttest_decorateds(
RRR/RRcRRRRR(((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyRss
			tDestructiveTestSuiteTestCasecBs)eZdZdZdZdZRS(s2
    Test for L{runner.DestructiveTestSuite}.
    csgdtjffdY}|d}tj}tj|g}|jg|j||jtg|j|j	ddS(sL
        Thes destructive test suite should run the tests normally.
        RacseZfdZRS(csjtdS(N(RRU(R-(tcalled(sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyRbs(RRRb((R(sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyRasRbiN(
RRcRRRtDestructiveTestSuiteR<R;RUR(RRaR-RQRd((RsB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyt
test_basics
csgdtjffdY}tj}tj}tj|_|j|}|j	g|j
||j	dg|j	|jddS(su
        Test the C{shouldStop} management: raising a C{KeyboardInterrupt} must
        interrupt the suite.
        Racs/eZfdZdZfdZRS(csjddS(Ni(R(R-(R(sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyt	test_foo1scSs
tdS(N(tKeyboardInterrupt(R-((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyt	test_foo2scsjddS(Ni(R(R-(R(sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyt	test_foo3s(RRRR R!((R(sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyRas	iN(RRcRRRRRtsuiteFactoryt	loadClassR<R;R(RRaRQRRd((RsB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyttest_shouldStops
cCsdtjfdY}|d}tj}tj|g}|j|jd|j||j|jddS(sn
        Checks that the test suite cleanups its tests during the run, so that
        it ends empty.
        RacBseZdZRS(cSsdS(N((R-((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyRbs(RRRb(((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyRasRbiiN(	RRcRRRRR<RR;(RRaR-RQRd((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyttest_cleanups
(RRR/RR$R%(((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyRs		tTestRunnerDeprecationcBs*eZdejfdYZdZRS(tFakeReportercBsDeZdZdZdZdZdZdZdZ	dZ
RS(s
        Fake reporter that does *not* implement done() but *does* implement
        printErrors, separator, printSummary, stream, write and writeln
        without deprecations.
        cGsdS(N((RR((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pytprintErrorsscGsdS(N((RR((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pytprintSummaryscGsdS(N((RR((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pytwritescGsdS(N((RR((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pytwritelnsN(RRR/R0R.R1R"R(R)R*R+(((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyR's			csftjd|jfd_fd}|jtdtjj	t
|dS(sk
        The runner emits a warning if it is using a result that doesn't
        implement 'done'.
        csS(N(((RQ(sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyt<lambda>scsjtjddS(NR(R;RgRc((R(sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pytfssR%s should implement done() but doesn't. Falling back to printErrors() and friends.N(RRMR0R'ROtassertWarnsR_R
RxRt__file__(RR-((RQRsB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyttest_reporterDeprecationss(RRRRR'R0(((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyR&s((9RLRRtzope.interfaceRtzope.interface.verifyRttwisted.trial.itrialRRt
twisted.trialRRRRttwisted.pythonRR	R
Rttwisted.python.filepathRttwisted.scriptsR
ttwisted.pluginsRttwistedRttwisted.internetRt
__import__RgR	RRR3RcRKRSRVR`ReRhRRRRR[RRRRR
RRRR&(((sB/usr/lib/python2.7/dist-packages/twisted/trial/test/test_runner.pyt<module>sD$""<=2

U	K
"(N.?