o ?Ogsã@sl ddlZddlZddlZddlmZddlmZdZGdd„deƒZ Gdd „d ej ƒZ Gd d „d eƒZ dS) éNé)Úresult)ÚregisterResultTc@s(eZdZ dd„Zdd„Zddd„ZdS) Ú_WritelnDecoratorcCs ||_dS©N)Ústream)Úselfr©r ú6/opt/alt/python310/lib64/python3.10/unittest/runner.pyÚ__init__s z_WritelnDecorator.__init__cCs|dvrt|ƒ‚t|j|ƒS)N)rÚ __getstate__)ÚAttributeErrorÚgetattrr)rÚattrr r r Ú __getattr__s z_WritelnDecorator.__getattr__NcCs|r| |¡| d¡dS©NÚ )Úwrite)rÚargr r r Úwritelns z_WritelnDecorator.writelnr)Ú__name__Ú __module__Ú __qualname__r rrr r r r r s rcs’eZdZ dZdZ‡fdd„Zdd„Z‡fdd„Z‡fd d „Z‡fd d „Z ‡fd d„Z ‡fdd„Z ‡fdd„Z ‡fdd„Z dd„Zdd„Z‡ZS)ÚTextTestResultzF======================================================================zF----------------------------------------------------------------------cs8tt|ƒ |||¡||_|dk|_|dk|_||_dS)Nr)Úsuperrr rÚshowAllÚdotsÚ descriptions)rrrÚ verbosity©Ú __class__r r r %s    zTextTestResult.__init__cCs,| ¡}|jr|rd t|ƒ|f¡St|ƒSr)ZshortDescriptionrÚjoinÚstr)rÚtestZdoc_first_liner r r ÚgetDescription,s zTextTestResult.getDescriptioncsFtt|ƒ |¡|jr!|j | |¡¡|j d¡|j ¡dSdS)Nz ... )rrÚ startTestrrrr$Úflush©rr#rr r r%3s  ýzTextTestResult.startTestcóTtt|ƒ |¡|jr|j d¡|j ¡dS|jr(|j d¡|j ¡dSdS)NÚokÚ.) rrÚ addSuccessrrrr&rrr'rr r r+:ó  þzTextTestResult.addSuccesscóVtt|ƒ ||¡|jr|j d¡|j ¡dS|jr)|j d¡|j ¡dSdS)NÚERRORÚE) rrÚaddErrorrrrr&rr©rr#Úerrrr r r0Có  þzTextTestResult.addErrorcr-)NÚFAILÚF) rrÚ addFailurerrrr&rrr1rr r r6Lr3zTextTestResult.addFailurecs\tt|ƒ ||¡|jr|j d |¡¡|j ¡dS|jr,|j  d¡|j ¡dSdS)Nz skipped {0!r}Ús) rrÚaddSkiprrrÚformatr&rr)rr#Úreasonrr r r8Us þzTextTestResult.addSkipcr-)Nzexpected failureÚx) rrÚaddExpectedFailurerrrr&rrr1rr r r<^r3z!TextTestResult.addExpectedFailurecr()Nzunexpected successÚu) rrÚaddUnexpectedSuccessrrrr&rrr'rr r r>gr,z#TextTestResult.addUnexpectedSuccesscCs@|js|jr|j ¡|j ¡| d|j¡| d|j¡dS)Nr.r4)rrrrr&ÚprintErrorListÚerrorsÚfailures©rr r r Ú printErrorsps   zTextTestResult.printErrorscCsb|D],\}}|j |j¡|j d|| |¡f¡|j |j¡|j d|¡|j ¡qdS)Nz%s: %sz%s)rrÚ separator1r$Ú separator2r&)rZflavourr@r#r2r r r r?ws  ûzTextTestResult.printErrorList)rrrrDrEr r$r%r+r0r6r8r<r>rCr?Ú __classcell__r r rr rs     rc@s6eZdZ eZ  d ddœdd„Zdd „Zd d „ZdS) ÚTextTestRunnerNTrF)Ú tb_localsc CsT |durtj}t|ƒ|_||_||_||_||_||_||_ |dur(||_ dSdSr) ÚsysÚstderrrrrrÚfailfastÚbufferrHÚwarningsÚ resultclass) rrrrrKrLrNrMrHr r r r ˆs  ÿzTextTestRunner.__init__cCs| |j|j|j¡Sr)rNrrrrBr r r Ú _makeResultœszTextTestRunner._makeResultc Cs` | ¡}t|ƒ|j|_|j|_|j|_t ¡V|jr0t |j¡|jdvr0tjdt ddt   ¡}t |ddƒ}|durA|ƒz||ƒWt |ddƒ}|durT|ƒnt |ddƒ}|durc|ƒwwt   ¡}Wdƒn1srwY||}|  ¡t|dƒr‹|j |j¡|j}|j d||d kr™d pšd |f¡|j ¡d } } } z tt|j|j|jfƒ} Wn tyÀYnw| \} } } g} | ¡sð|j d ¡t|jƒt|jƒ}}|ræ|  d|¡|rï|  d|¡n|j d¡| rÿ|  d| ¡| r |  d| ¡| r|  d| ¡| r#|j dd | ¡f¡n|j d¡|j ¡|S)N)ÚdefaultÚalwaysÚmodulezPlease use assert\w+ instead.)ÚcategoryÚmessageÚ startTestRunÚ stopTestRunrEzRan %d test%s in %.3fsrr7ÚrZFAILEDz failures=%dz errors=%dZOKz skipped=%dzexpected failures=%dzunexpected successes=%dz (%s)z, r) rOrrKrLrHrMÚcatch_warningsÚ simplefilterÚfilterwarningsÚDeprecationWarningÚtimeÚ perf_counterrrCÚhasattrrrrEZtestsRunÚmapÚlenZexpectedFailuresÚunexpectedSuccessesÚskippedr Z wasSuccessfulrrAr@Úappendr!r&)rr#rZ startTimerUrVZstopTimeZ timeTakenÚrunZ expectedFailsrarbZresultsZinfosZfailedZerroredr r r rdŸsŒ   þ   € þÿ é ÿ   þ ÿ  €   zTextTestRunner.run)NTrFFNN)rrrrrNr rOrdr r r r rG€sÿ þ rG) rIr\rMrWrZsignalsrZ __unittestÚobjectrZ TestResultrrGr r r r Ús  c