%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/local/lib/python3.8/unittest/__pycache__/
Upload File :
Create Path :
Current File : //usr/local/lib/python3.8/unittest/__pycache__/result.cpython-38.pyc

U

qa@s\dZddlZddlZddlZddlmZddlmZdZddZ	d	Z
d
ZGdddeZ
dS)
zTest result objectN)utilwrapsTcstfdd}|S)Ncs$t|ddr||f||S)NfailfastF)getattrstop)selfargskwmethod+/usr/local/lib/python3.8/unittest/result.pyinner
szfailfast.<locals>.innerr)r
rrrrrsrz
Stdout:
%sz
Stderr:
%sc@seZdZdZdZdZdZd.ddZddZdd	Z	d
dZ
dd
ZddZddZ
ddZeddZeddZddZddZddZddZed d!Zd"d#Zd$d%Zd&d'Zd(d)Zd*d+Zd,d-ZdS)/
TestResultaHolder for test result information.

    Test results are automatically managed by the TestCase and TestSuite
    classes, and do not need to be explicitly manipulated by writers of tests.

    Each instance holds the total number of tests run, and collections of
    failures and errors that occurred among those test runs. The collections
    contain tuples of (testcase, exceptioninfo), where exceptioninfo is the
    formatted traceback of the error that occurred.
    NFcCsbd|_g|_g|_d|_g|_g|_g|_d|_d|_d|_	d|_
d|_tj
|_tj|_d|_dS)NFr)rfailureserrorstestsRunskippedexpectedFailuresunexpectedSuccesses
shouldStopbuffer	tb_locals_stdout_buffer_stderr_buffersysstdout_original_stdoutstderr_original_stderr
_mirrorOutput)r	streamZdescriptions	verbosityrrr__init__&szTestResult.__init__cCsdS)z#Called by TestRunner after test runNrr	rrrprintErrors7szTestResult.printErrorscCs |jd7_d|_|dS)z-Called when the given test is about to be runrFN)rr"_setupStdoutr	testrrr	startTest:szTestResult.startTestcCs8|jr4|jdkr$t|_t|_|jt_|jt_dS)N)rrioStringIOrrrr r&rrrr(@s


zTestResult._setupStdoutcCsdS)zpCalled once before any tests are executed.

        See startTest for a method called before each test.
        Nrr&rrrstartTestRunHszTestResult.startTestRuncCs|d|_dS)z'Called when the given test has been runFN)_restoreStdoutr"r)rrrstopTestNszTestResult.stopTestcCs|jr|jrltj}tj}|rF|ds6|d7}|jt	||rl|ds\|d7}|j
t||jt_|j
t_|j
d|j|j
d|jdS)N
r)rr"rrgetvaluer endswithrwriteSTDOUT_LINEr!STDERR_LINErseektruncater)r	outputerrorrrrr/Ss$




zTestResult._restoreStdoutcCsdS)zmCalled once after all tests are executed.

        See stopTest for a method called after each test.
        Nrr&rrrstopTestRunhszTestResult.stopTestRuncCs"|j||||fd|_dS)zmCalled when an error has occurred. 'err' is a tuple of values as
        returned by sys.exc_info().
        TN)rappend_exc_info_to_stringr"r	r*errrrraddErrornszTestResult.addErrorcCs"|j||||fd|_dS)zdCalled when an error has occurred. 'err' is a tuple of values as
        returned by sys.exc_info().TN)rr<r=r"r>rrr
addFailurevszTestResult.addFailurecCsZ|dk	rVt|ddr|t|d|jr4|j}n|j}|||||fd|_dS)zCalled at the end of a subtest.
        'err' is None if the subtest ended successfully, otherwise it's a
        tuple of values as returned by sys.exc_info().
        NrFrT)	rr
issubclassfailureExceptionrrr<r=r")r	r*Zsubtestr?rrrr
addSubTest}szTestResult.addSubTestcCsdS)z-Called when a test has completed successfullyNrr)rrr
addSuccessszTestResult.addSuccesscCs|j||fdS)zCalled when a test is skipped.N)rr<)r	r*reasonrrraddSkipszTestResult.addSkipcCs|j||||fdS)z/Called when an expected failure/error occurred.N)rr<r=r>rrraddExpectedFailureszTestResult.addExpectedFailurecCs|j|dS)z5Called when a test was expected to fail, but succeed.N)rr<r)rrraddUnexpectedSuccessszTestResult.addUnexpectedSuccesscCs>t|jt|jkodkno<t|dp<t|jdkS)z/Tells whether or not this result was a success.rr)lenrrhasattrrr&rrr
wasSuccessfuls$zTestResult.wasSuccessfulcCs
d|_dS)z+Indicates that the tests should be aborted.TN)rr&rrrrszTestResult.stopcCs|\}}}|r ||r |j}q
||jkr6||}nd}tj|||||jd}t|}|j	rt
j}	t
j
}
|	r|	ds|	d7}	|t|	|
r|
ds|
d7}
|t|
d|S)z>Converts a sys.exc_info()-style tuple of values into a string.N)limitcapture_localsr1)_is_relevant_tb_leveltb_nextrC_count_relevant_tb_levels	tracebackTracebackExceptionrlistformatrrrr2r r3r<r5r6join)r	r?r*exctypevaluetblengthZtb_eZmsgLinesr9r:rrrr=s4





zTestResult._exc_info_to_stringcCsd|jjkS)N
__unittest)tb_frame	f_globals)r	rZrrrrPsz TestResult._is_relevant_tb_levelcCs&d}|r"||s"|d7}|j}q|S)Nrr)rPrQ)r	rZr[rrrrRs
z$TestResult._count_relevant_tb_levelscCs&dt|j|jt|jt|jfS)Nz!<%s run=%i errors=%i failures=%i>)rZstrclass	__class__rrJrrr&rrr__repr__s
zTestResult.__repr__)NNN)__name__
__module____qualname____doc__Z_previousTestClassZ_testRunEnteredZ_moduleSetUpFailedr%r'r+r(r.r0r/r;rr@rArDrErGrHrIrLrr=rPrRr`rrrrrs8




	r)rdr,rrSrOr	functoolsrr\rr5r6objectrrrrr<module>s

Zerion Mini Shell 1.0