ó
    F\hª#  ã                   ó`   • S r SSKrSSKrSSKrSSKJr  SSKJr  SrS r	Sr
S	r " S
 S\5      rg)zTest result objecté    Né   )Úutil©ÚwrapsTc                 ó0   ^ • [        T 5      U 4S j5       nU$ )Nc                 ó`   >• [        U SS5      (       a  U R                  5         T" U /UQ70 UD6$ )NÚfailfastF)ÚgetattrÚstop)ÚselfÚargsÚkwÚmethods      €Ú&/usr/lib/python3.13/unittest/result.pyÚinnerÚfailfast.<locals>.inner   s0   ø€ ä�4˜ U×+Ñ+Ø�I‰IŒKÙ�dÐ(˜TÒ( RÑ(Ð(ó    r   )r   r   s   ` r   r	   r	      s    ø€ Ü
ˆ6ƒ]ô)ó ð)ð €Lr   z
Stdout:
%sz
Stderr:
%sc                   óÐ   • \ rS rSrSrSrSrSrSS jrS r	S r
S rS	 rS
 rS rS r\S 5       r\S 5       rS rS rS rS r\S 5       rS rS rS rS rS rS rS rS rSr g)Ú
TestResulté   a½  Holder 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.
NFc                 ó  • SU l         / U l        / U l        SU l        / U l        / U l        / U l        / U l        SU l        SU l	        SU l
        S U l        S U l        [        R                  U l        [        R                   U l        SU l        g )NFr   )r	   ÚfailuresÚerrorsÚtestsRunÚskippedÚexpectedFailuresÚunexpectedSuccessesÚcollectedDurationsÚ
shouldStopÚbufferÚ	tb_localsÚ_stdout_bufferÚ_stderr_bufferÚsysÚstdoutÚ_original_stdoutÚstderrÚ_original_stderrÚ_mirrorOutput)r   ÚstreamÚdescriptionsÚ	verbositys       r   Ú__init__ÚTestResult.__init__&   s‚   € ØˆŒØˆŒØˆŒØˆŒØˆŒØ "ˆÔØ#%ˆÔ Ø"$ˆÔØˆŒØˆŒØˆŒØ"ˆÔØ"ˆÔÜ #§
¡
ˆÔÜ #§
¡
ˆÔØ"ˆÕr   c                 ó   • g)z#Called by TestRunner after test runN© ©r   s    r   ÚprintErrorsÚTestResult.printErrors8   ó   � r   c                 ó\   • U =R                   S-  sl         SU l        U R                  5         g)z-Called when the given test is about to be runr   FN)r   r)   Ú_setupStdout©r   Útests     r   Ú	startTestÚTestResult.startTest;   s$   € à�Š˜Ñ�Ø"ˆÔØ×ÑÕr   c                 óþ   • U R                   (       al  U R                  c4  [        R                  " 5       U l        [        R                  " 5       U l        U R                  [
        l        U R                  [
        l        g g )N)r    r#   ÚioÚStringIOr"   r$   r%   r'   r1   s    r   r6   ÚTestResult._setupStdoutA   sP   € Ø�;�;Ø×"Ñ"Ñ*Ü&(§k¢k£m�Ô#Ü&(§k¢k£m�Ô#Ø×,Ñ,ŒCŒJØ×,Ñ,ŒC�Jð r   c                 ó   • g)z`Called once before any tests are executed.

See startTest for a method called before each test.
Nr0   r1   s    r   ÚstartTestRunÚTestResult.startTestRunI   r4   r   c                 ó2   • U R                  5         SU l        g)z'Called when the given test has been runFN)Ú_restoreStdoutr)   r7   s     r   ÚstopTestÚTestResult.stopTestO   s   € à×ÑÔØ"ˆÕr   c                 óü  • U R                   (       Gaj  U R                  (       aÄ  [        R                  R	                  5       n[        R
                  R	                  5       nU(       a=  UR                  S5      (       d  US-  nU R                  R                  [        U-  5        U(       a=  UR                  S5      (       d  US-  nU R                  R                  [        U-  5        U R                  [        l        U R                  [        l        U R                  R                  S5        U R                  R                  5         U R                  R                  S5        U R                  R                  5         g g )NÚ
r   )r    r)   r$   r%   Úgetvaluer'   Úendswithr&   ÚwriteÚSTDOUT_LINEr(   ÚSTDERR_LINEr"   ÚseekÚtruncater#   )r   ÚoutputÚerrors      r   rC   ÚTestResult._restoreStdoutT   s  € Ø�;�;ˆ;Ø×!×!ÜŸ™×,Ñ,Ó.�ÜŸ
™
×+Ñ+Ó-�ÞØ!Ÿ?™?¨4×0Ñ0Ø $™˜Ø×)Ñ)×/Ñ/´¸fÑ0DÔEÞØ Ÿ>™>¨$×/Ñ/Ø ™˜Ø×)Ñ)×/Ñ/´¸eÑ0CÔDà×.Ñ.ŒCŒJØ×.Ñ.ŒCŒJØ×Ñ×$Ñ$ QÔ'Ø×Ñ×(Ñ(Ô*Ø×Ñ×$Ñ$ QÔ'Ø×Ñ×(Ñ(Õ*ð% r   c                 ó   • g)z]Called once after all tests are executed.

See stopTest for a method called after each test.
Nr0   r1   s    r   ÚstopTestRunÚTestResult.stopTestRuni   r4   r   c                 óh   • U R                   R                  XR                  X!5      45        SU l        g)z]Called when an error has occurred. 'err' is a tuple of values as
returned by sys.exc_info().
TN)r   ÚappendÚ_exc_info_to_stringr)   ©r   r8   Úerrs      r   ÚaddErrorÚTestResult.addErroro   s,   € ð
 	�‰×Ñ˜D×":Ñ":¸3Ó"EÐFÔGØ!ˆÕr   c                 óh   • U R                   R                  XR                  X!5      45        SU l        g)z\Called when an error has occurred. 'err' is a tuple of values as
returned by sys.exc_info().TN)r   rV   rW   r)   rX   s      r   Ú
addFailureÚTestResult.addFailurew   s,   € ð 	�‰×Ñ˜d×$<Ñ$<¸SÓ$GÐHÔIØ!ˆÕr   c                 ó  • Ub‚  [        U SS5      (       a  U R                  5         [        US   UR                  5      (       a  U R                  nOU R
                  nUR                  X R                  X15      45        SU l        gg)z‘Called 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().
Nr	   Fr   T)	r
   r   Ú
issubclassÚfailureExceptionr   r   rV   rW   r)   )r   r8   ÚsubtestrY   r   s        r   Ú
addSubTestÚTestResult.addSubTest~   sq   € ð ‰?Ü�t˜Z¨×/Ñ/Ø—	‘	”Ü˜#˜a™& $×"7Ñ"7×8Ñ8ØŸ™‘àŸ™�Ø�M‰M˜7×$<Ñ$<¸SÓ$GÐHÔIØ!%ˆDÕð r   c                 ó   • g)z-Called when a test has completed successfullyNr0   r7   s     r   Ú
addSuccessÚTestResult.addSuccess�   s   € àr   c                 ó<   • U R                   R                  X45        g)zCalled when a test is skipped.N)r   rV   )r   r8   Úreasons      r   ÚaddSkipÚTestResult.addSkip“   s   € à�‰×Ñ˜T˜NÕ+r   c                 óZ   • U R                   R                  XR                  X!5      45        g)z/Called when an expected failure/error occurred.N)r   rV   rW   rX   s      r   ÚaddExpectedFailureÚTestResult.addExpectedFailure—   s'   € à×Ñ×$Ñ$Ø×+Ñ+¨CÓ6Ð7õ	9r   c                 ó:   • U R                   R                  U5        g)z5Called when a test was expected to fail, but succeed.N)r   rV   r7   s     r   ÚaddUnexpectedSuccessÚTestResult.addUnexpectedSuccessœ   s   € ð 	× Ñ ×'Ñ'¨Õ-r   c                 ót   • [        U S5      (       a'  U R                  R                  [        U5      U45        gg)zÛCalled when a test finished to run, regardless of its outcome.
*test* is the test case corresponding to the test method.
*elapsed* is the time represented in seconds, and it includes the
execution of cleanup functions.
r   N)Úhasattrr   rV   Ústr)r   r8   Úelapseds      r   ÚaddDurationÚTestResult.addDuration¡   s4   € ô �4Ð-×.Ñ.à×#Ñ#×*Ñ*¬C°«I°wÐ+?Õ@ð /r   c                 óæ   • [        U R                  5      [        U R                  5      s=:H  =(       a    S:H  Os  =(       a0    [        U S5      (       + =(       d    [        U R                  5      S:H  $ )z/Tells whether or not this result was a success.r   r   )Úlenr   r   rs   r   r1   s    r   ÚwasSuccessfulÚTestResult.wasSuccessful¬   sV   € ô
 �T—]‘]Ó#¤s¨4¯;©;Ó'7×<Ó<¸1Ô<÷ 5Ü˜TÐ#8Ó9Ô9÷ 4Ü�T×-Ñ-Ó.°!Ñ3ð	6r   c                 ó   • SU l         g)z+Indicates that the tests should be aborted.TN)r   r1   s    r   r   ÚTestResult.stopµ   s	   € àˆ�r   c                 óH  • Uu  p4nU R                  X4XR5      n[        R                  " X4UU R                  SS9n[	        UR                  5       5      nU R                  (       a°  [        R                  R                  5       n[        R                  R                  5       n	U(       a3  UR                  S5      (       d  US-  nUR                  [        U-  5        U	(       a3  U	R                  S5      (       d  U	S-  n	UR                  [        U	-  5        SR                  U5      $ )z>Converts a sys.exc_info()-style tuple of values into a string.T)Úcapture_localsÚcompactrG   Ú )Ú_clean_tracebacksÚ	tracebackÚTracebackExceptionr!   ÚlistÚformatr    r$   r%   rH   r'   rI   rV   rK   rL   Újoin)
r   rY   r8   ÚexctypeÚvalueÚtbÚtb_eÚmsgLinesrO   rP   s
             r   rW   ÚTestResult._exc_info_to_string¹   sà   € à Ñˆ˜Ø×#Ñ# G°BÓ=ˆÜ×+Ò+Ø˜BØŸ>™>°4ñ9ˆô ˜Ÿ™›Ó&ˆà�;�;Ü—Z‘Z×(Ñ(Ó*ˆFÜ—J‘J×'Ñ'Ó)ˆEÞØ—‘ t×,Ñ,Ø˜d‘N�FØ—‘¤¨fÑ 4Ô5ÞØ—~‘~ d×+Ñ+Ø˜T‘M�EØ—‘¤¨eÑ 3Ô4Ø�w‰w�xÓ Ð r   c                 ó\  • S nSnXU4/n[        U5      1nU(       Ga  UR                  5       u  pnU(       aA  U R                  U5      (       a+  UR                  nU(       a  U R                  U5      (       a  M+  XR                  L a  U R                  U5        U(       a  UnSnOX2l        Ubu  UR                  UR                  4 HY  n	U	c  M  [        U	5      U;  d  M  UR                  [        U	5      X™R                  45        UR                  [        U	5      5        M[     U(       a  GM  U$ )NTF)ÚidÚpopÚ_is_relevant_tb_levelÚtb_nextra   Ú_remove_unittest_tb_framesÚ__traceback__Ú	__cause__Ú__context__rV   ÚtypeÚadd)
r   rˆ   r‰   rŠ   r8   ÚretÚfirstÚexcsÚseenÚcs
             r   r‚   ÚTestResult._clean_tracebacksÏ   sü   € ØˆØˆØ Ð$Ð%ˆÜ�5“	ˆ{ˆßØ#'§8¡8£:Ñ ˆW˜Ræ˜×3Ñ3°B×7Ñ7Ø—Z‘Z�ö ˜×3Ñ3°B×7Ó7ð ×/Ñ/Ò/Ø×/Ñ/°Ô3æØ�Ø‘à&(Ô#àÑ ØŸ/™/¨5×+<Ñ+<Ó=�AØ“}¬¨A«°dÕ):ØŸ™¤T¨!£W¨a·±Ð$AÔBØŸ™¤ A£žñ >÷# ‰dð* ˆ
r   c                 ó4   • SUR                   R                  ;   $ )NÚ
__unittest)Útb_frameÚ	f_globals)r   rŠ   s     r   r‘   Ú TestResult._is_relevant_tb_levelë   s   € Ø˜rŸ{™{×4Ñ4Ñ4Ð4r   c                 ó²   • SnU(       aC  U R                  U5      (       d-  UnUR                  nU(       a  U R                  U5      (       d  M-  Ub  SUl        gg)zõTruncates usercode tb at the first unittest frame.

If the first frame of the traceback is in user code,
the prefix up to the first unittest frame is returned.
If the first frame is already in the unittest module,
the traceback is not modified.
N)r‘   r’   )r   rŠ   Úprevs      r   r“   Ú%TestResult._remove_unittest_tb_framesî   sS   € ð ˆÞ˜×3Ñ3°B×7Ñ7ØˆDØ—‘ˆBö ˜×3Ñ3°B×7Ó7ð ÑØˆD�Lð r   c                 ó°   • S[         R                  " U R                  5      U R                  [	        U R
                  5      [	        U R                  5      4-  $ )Nz!<%s run=%i errors=%i failures=%i>)r   ÚstrclassÚ	__class__r   ry   r   r   r1   s    r   Ú__repr__ÚTestResult.__repr__ý   sA   € Ø3Ü—’˜dŸn™nÓ-¨t¯}©}¼cÀ$Ç+Á+Ó>NÜ�D—M‘MÓ"ð$ñ$ð 	%r   )r)   r(   r&   r#   r"   r    r   r   r   r	   r   r   r   r!   r   r   )NNN)!Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú_previousTestClassÚ_testRunEnteredÚ_moduleSetUpFailedr-   r2   r9   r6   r@   rD   rC   rS   r	   rZ   r]   rc   rf   rj   rm   rp   rv   rz   r   rW   r‚   r‘   r“   rª   Ú__static_attributes__r0   r   r   r   r      s»   † ñ	ð ÐØ€OØÐô#ò$.òò-òò#ò
+ò*ð ñ"ó ð"ð ñ"ó ð"ò&ò"ò,ò9ð
 ñ.ó ð.ò	Aò6òò!ò,ò85ò õ%r   r   )r°   r<   r$   rƒ   r�   r   Ú	functoolsr   r    r	   rK   rL   Úobjectr   r0   r   r   Ú<module>r·      s;   ðÙ ã 	Û 
Û å Ý à€
òð €Ø€ôh%�õ h%r   