U e5dã@sXddlZddlZddlZddlmZddlmZdZdd„ZdZ d Z Gd d „d e ƒZ dS) éNé)Úutil©ÚwrapsTcstˆƒ‡fdd„ƒ}|S)Ncs$t|ddƒr| ¡ˆ|f|ž|ŽS)NÚfailfastF)ÚgetattrÚstop)ÚselfÚargsÚkw©Úmethod©ú'/usr/lib64/python3.8/unittest/result.pyÚinner s zfailfast..innerr)r rrr rr srz Stdout: %sz Stderr: %sc@sÎeZdZdZdZdZd-dd„Zdd„Zdd„Zd d „Z d d „Z d d„Z dd„Z dd„Z edd„ƒZedd„ƒZdd„Zdd„Zdd„Zdd„Zedd „ƒZd!d"„Zd#d$„Zd%d&„Zd'd(„Zd)d*„Zd+d,„ZdS).Ú TestResultNFcCsbd|_g|_g|_d|_g|_g|_g|_d|_d|_d|_ d|_ d|_ t j |_t j|_d|_dS)NFr)rÚfailuresÚerrorsÚtestsRunÚskippedÚexpectedFailuresÚunexpectedSuccessesÚ shouldStopÚbufferÚ tb_localsÚ_stdout_bufferÚ_stderr_bufferÚsysÚstdoutÚ_original_stdoutÚstderrÚ_original_stderrÚ _mirrorOutput)r ÚstreamZ descriptionsÚ verbosityrrrÚ__init__&szTestResult.__init__cCsdS©Nr©r rrrÚ printErrors7szTestResult.printErrorscCs |jd7_d|_| ¡dS)NrF)rr"Ú _setupStdout©r ÚtestrrrÚ startTest:szTestResult.startTestcCs8|jr4|jdkr$t ¡|_t ¡|_|jt_|jt_dSr&)rrÚioÚStringIOrrrr r'rrrr)@s    zTestResult._setupStdoutcCsdSr&rr'rrrÚ startTestRunHszTestResult.startTestRuncCs| ¡d|_dS)NF)Ú_restoreStdoutr"r*rrrÚstopTestNszTestResult.stopTestcCs¬|jr¨|jrltj ¡}tj ¡}|rF| d¡s6|d7}|j t |¡|rl| d¡s\|d7}|j  t |¡|jt_|j t_|j   d¡|j  ¡|j  d¡|j ¡dS)NÚ r)rr"rrÚgetvaluer ÚendswithrÚwriteÚ STDOUT_LINEr!Ú STDERR_LINErÚseekÚtruncater)r ÚoutputÚerrorrrrr0Ss$       zTestResult._restoreStdoutcCsdSr&rr'rrrÚ stopTestRunhszTestResult.stopTestRuncCs"|j || ||¡f¡d|_dS©NT)rÚappendÚ_exc_info_to_stringr"©r r+ÚerrrrrÚaddErrornszTestResult.addErrorcCs"|j || ||¡f¡d|_dSr=)rr>r?r"r@rrrÚ addFailurevszTestResult.addFailurecCsZ|dk rVt|ddƒr| ¡t|d|jƒr4|j}n|j}| || ||¡f¡d|_dS)NrFrT) rrÚ issubclassÚfailureExceptionrrr>r?r")r r+ZsubtestrArrrrÚ addSubTest}s zTestResult.addSubTestcCsdSr&rr*rrrÚ addSuccessŽszTestResult.addSuccesscCs|j ||f¡dSr&)rr>)r r+ÚreasonrrrÚaddSkip’szTestResult.addSkipcCs|j || ||¡f¡dSr&)rr>r?r@rrrÚaddExpectedFailure–sÿzTestResult.addExpectedFailurecCs|j |¡dSr&)rr>r*rrrÚaddUnexpectedSuccess›szTestResult.addUnexpectedSuccesscCs>t|jƒt|jƒkodknor6r7Újoin) r rAr+ÚexctypeÚvalueÚtbÚlengthZtb_eZmsgLinesr:r;rrrr?­s4   ÿ     zTestResult._exc_info_to_stringcCs d|jjkS)NÚ __unittest)Útb_frameÚ f_globals)r r\rrrrRËsz TestResult._is_relevant_tb_levelcCs&d}|r"| |¡s"|d7}|j}q|S)Nrr)rRrS)r r\r]rrrrTÎs z$TestResult._count_relevant_tb_levelscCs&dt |j¡|jt|jƒt|jƒfS)Nz!<%s run=%i errors=%i failures=%i>)rZstrclassÚ __class__rrLrrr'rrrÚ__repr__Õs ÿÿzTestResult.__repr__)NNN)Ú__name__Ú __module__Ú __qualname__Z_previousTestClassZ_testRunEnteredZ_moduleSetUpFailedr%r(r,r)r/r1r0r<rrBrCrFrGrIrJrKrNrr?rRrTrbrrrrrs6      r) r-rrUrQrÚ functoolsrr^rr6r7ÚobjectrrrrrÚs