+
    üÐjÃŠ  ã                  óÔ  € R t ^ RIHt ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	H
t
 ^ RIHt ^ RIHt ^ RIHt ^ RIHtHtHt ^ RIHt ^ R	IHt ^ R
IHtHt ^ RIHt  ! R R]4      tRR/R R llt ! R R]4      t  ! R R]4      t! ! R R]"4      t# ! R R]]#R7      t$ ! R R]4      t% ! R R]4      t&R R  lt' ! R! R"]4      t( ! R# R$]4      t) ! R% R&]4      t* ! R' R(]4      t+R# ))z6
Test cases for the L{twisted.python.failure} module.
)ÚannotationsN)Údistb)ÚStringIO©ÚFrameSummary)ÚTracebackType)ÚAnyÚ	GeneratorÚcast)ÚskipIf)Úraiser)ÚfailureÚreflect)ÚSynchronousTestCasec                  ó&   € ] tR t^tRtR R ltRtR# )ÚComparableExceptionz+An exception that can be compared by value.c               ó    € V ^8„  d   QhRRRR/# )é   ÚotherÚobjectÚreturnÚbool© )Úformats   "ÚB/usr/lib/python3/dist-packages/twisted/test/ignore_test_failure.pyÚ__annotate__Ú ComparableException.__annotate__   s   € ÷ 
ñ 
˜Fð 
 tñ 
ó    c                	ó’   € V P                   VP                   8H  ;'       d(    V P                  \        \        V4      P                  8H  # ©N)Ú	__class__Úargsr
   r   )Úselfr   s   &&r   Ú__eq__ÚComparableException.__eq__   s;   € Ø—‘ %§/¡/Ñ1÷ 
ð 
Ø�I‰IœÔ1°5Ó9×>Ñ>Ñ>ð	
r   r   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r#   Ú__static_attributes__r   r   r   r   r      s   † Ù5÷
ñ 
r   r   ÚcaptureVarsFc               ó    € V ^8„  d   QhRRRR/# )r   r+   r   r   úfailure.Failurer   )r   s   "r   r   r   %   s   € ÷ ñ  tð ¸ñ r   c                ó„   € V '       d   RpV  ^^ ,           X#   \          d    \        P                  ! T R7      p T# i ; i)z.
Make a C{Failure} of a divide-by-zero error.
Úxyz©r+   )ÚBaseExceptionr   ÚFailure)r+   ÚexampleLocalVarÚfs   $  r   ÚgetDivisionFailurer5   %   sH   € ÷ Øˆñ 	ð5Ø	ˆAŽð €Høô ô 5Ü�OŠO¨Ô4‰Ø€Hð5ús   Ž	 ™"?¾?c                  óî  € ] tR t^6tRtR R ltR R ltR R ltR R	 ltR
 R lt	R R lt
R R ltRPR R lltRQR R lltRQR R lltR R ltR R ltR R ltR R ltR R ltR  R! ltR" R# ltR$ R% ltR& R' ltR( R) ltR* R+ ltR, R- ltR. R/ ltR0 R1 ltR2 R3 ltR4 R5 ltR6 R7 ltR8 R9 lt R: R; lt!R< R= lt"R> R? lt#R@ RA lt$RB RC lt%RD RE lt&RF RG lt'RH RI lt(RJ RK lt)RL RM lt*RNt+RO# )RÚFailureTestsz
Tests for L{failure.Failure}.
c               ó   € V ^8„  d   QhRR/# ©r   r   ÚNoner   )r   s   "r   r   ÚFailureTests.__annotate__;   s   € ÷ 
6ñ 
6 $ñ 
6r   c                ó
  €  \        R4      h  \         d    \        P                  ! 4       p Mi ; iTP	                  \
        \        4      pT P                  T\        4       T P                  TP                  \         4       R# )z
Trapping a L{Failure}.
ÚtestN)	ÚNotImplementedErrorr1   r   r2   ÚtrapÚ
SystemExitÚRuntimeErrorÚassertEqualÚtype)r"   r4   Úerrors   &  r   Útest_failAndTrapÚFailureTests.test_failAndTrap;   sb   € ð	"Ü% fÓ-Ð-øÜô 	"Ü—’Ó!ŠAð	"úà—‘”z¤<Ó0ˆØ×Ñ˜¤Ô-Ø×Ñ˜Ÿ™Ô!4Ö5s   ‚ � 0¯0c               ó   € V ^8„  d   QhRR/# r9   r   )r   s   "r   r   r;   G   s   € ÷ ,ñ ,°ñ ,r   c                óØ   € \        4       p Vh  \         d    \        P                  ! 4       p Mi ; iT P	                  \         TP
                  \        4      pT P                  Y4       R# )z†
If the wrapped C{Exception} is not a subclass of one of the
expected types, L{failure.Failure.trap} raises the wrapped
C{Exception}.
N)Ú
ValueErrorr1   r   r2   ÚassertRaisesr?   ÚOverflowErrorÚassertIs)r"   Ú	exceptionr4   Ú	untrappeds   &   r   Útest_trapRaisesWrappedExceptionÚ,FailureTests.test_trapRaisesWrappedExceptionG   sV   € ô “Lˆ	ð	"ØˆOøÜô 	"Ü—’Ó!ŠAð	"úð ×%Ñ%¤j°!·&±&¼-ÓHˆ	Ø�‰�iÖ+s   Œ Ž 1°1c               ó   € V ^8„  d   QhRR/# r9   r   )r   s   "r   r   r;   V   s   € ÷ 	+ñ 	+¨dñ 	+r   c                óª   € \        4       p\        P                  ! V4      p\        P                  ! V4      pV P                  VP                  V4       R# )zœ
A L{failure.Failure} constructed from another
L{failure.Failure} instance, has its C{value} property set to
the value of that L{failure.Failure} instance.
N)rI   r   r2   rL   Úvalue©r"   rM   Úf1Úf2s   &   r   Útest_failureValueFromFailureÚ)FailureTests.test_failureValueFromFailureV   s9   € ô “Lˆ	Ü�_Š_˜YÓ'ˆÜ�_Š_˜RÓ ˆØ�‰�b—h‘h 	Ö*r   c               ó   € V ^8„  d   QhRR/# r9   r   )r   s   "r   r   r;   a   s   € ÷ +ñ +°4ñ +r   c                óö   € \        4       p\        P                  ! V4      p VP                  \        4       V P                  XP                  V4       R#   \
         d    \        P                  ! 4       p L@i ; i)z·
A L{failure.Failure} constructed without a C{exc_value}
argument, will search for an "original" C{Failure}, and if
found, its value will be used as the value for the new
C{Failure}.
N)rI   r   r2   r?   rK   r1   rL   rS   rT   s   &   r   Ú!test_failureValueFromFoundFailureÚ.FailureTests.test_failureValueFromFoundFailurea   s[   € ô “Lˆ	Ü�_Š_˜YÓ'ˆð	#Ø�G‰G”MÔ"ð 	�‰�b—h‘h 	Ö*øô ô 	#Ü—’Ó"ŠBð	#ús   ¢A Á A8Á7A8c               ó$   € V ^8„  d   QhRRRRRR/# )r   ÚsÚstrÚprefixr   r:   r   )r   s   "r   r   r;   q   s&   € ÷ 	Wñ 	W #ð 	W¨sð 	W°tñ 	Wr   c                óV   € V P                  VP                  V4      V: RV: 24       R# )z¯
Assert that C{s} starts with a particular C{prefix}.

@param s: The input string.
@type s: C{str}
@param prefix: The string that C{s} should start with.
@type prefix: C{str}
z is not the start of N)Ú
assertTrueÚ
startswith)r"   r^   r`   s   &&&r   ÚassertStartsWithÚFailureTests.assertStartsWithq   s(   € ð 	�‰˜Ÿ™ VÓ,°±
Ð:OÐPQÉuÐ.UÖVr   c               ó$   € V ^8„  d   QhRRRRRR/# )r   r^   r_   Úsuffixr   r:   r   )r   s   "r   r   r;   |   s&   € ÷ 	Sñ 	S ð 	S¨Sð 	S°Tñ 	Sr   c                óV   € V P                  VP                  V4      V: RV: 24       R# )zª
Assert that C{s} end with a particular C{suffix}.

@param s: The input string.
@type s: C{str}
@param suffix: The string that C{s} should end with.
@type suffix: C{str}
z is not the end of N)rb   Úendswith)r"   r^   rg   s   &&&r   ÚassertEndsWithÚFailureTests.assertEndsWith|   s'   € ð 	�‰˜Ÿ
™
 6Ó*¨v©jÐ8KÈAÉ5Ð,QÖRr   c               ó(   € V ^8„  d   QhRRRRRRRR/# )r   Útbr_   r`   rg   r   r:   r   )r   s   "r   r   r;   ‡   s(   € ÷ (ñ (¨ð (°Sð (À#ð (È$ñ (r   c                óJ   € V P                  W4       V P                  W4       R# )a  
Assert that the C{tb} traceback contains a particular C{prefix} and
C{suffix}.

@param tb: The traceback string.
@type tb: C{str}
@param prefix: The string that C{tb} should start with.
@type prefix: C{str}
@param suffix: The string that C{tb} should end with.
@type suffix: C{str}
N)rd   rj   )r"   rm   r`   rg   s   &&&&r   ÚassertTracebackFormatÚ"FailureTests.assertTracebackFormat‡   s    € ð 	×Ñ˜bÔ)Ø×Ñ˜BÖ'r   c               ó$   € V ^8„  d   QhRRRRRR/# )r   r+   r   ÚcleanFailurer   r:   r   )r   s   "r   r   r;   –   s)   € ÷ Jñ JØðJØ7;ðJà	ñJr   c                ó  € \        VR7      p\        4       pV'       d   VP                  4        VP                  V4       VP	                  4       pRVP
                  VP                  ;'       d    R;'       g    R3,          pRP                  \        P                  ! VP                  4      \        P                  ! VP                  4      VP
                  4      pV P                  WVV4       VP                  4        Uu. uF  qˆP                  R4      '       g   K  VNK  	  p	pV'       d3   V P!                  . V	4       V'       d   RpMRpV P#                  W‰4       R
# V P%                  . V	4       V P#                  R	V4       R
# u upi )aŽ  
Assert that L{printDetailedTraceback} produces and prints a detailed
traceback.

The detailed traceback consists of a header::

  *--- Failure #20 ---

The body contains the stacktrace::

  /twisted/test/test_failure.py:39: getDivisionFailure(...)

If C{captureVars} is enabled the body also includes a list of
globals and locals::

   [ Locals ]
     exampleLocalVar : 'xyz'
     ...
   ( Globals )
     ...

Or when C{captureVars} is disabled::

   [Capture of Locals and Globals disabled (use captureVars=True)]

When C{cleanFailure} is enabled references to other objects are removed
and replaced with strings.

And finally the footer with the L{Failure}'s value::

  exceptions.ZeroDivisionError: float division
  *--- End of Failure #20 ---

@param captureVars: Enables L{Failure.captureVars}.
@type captureVars: C{bool}
@param cleanFailure: Enables L{Failure.cleanFailure}.
@type cleanFailure: C{bool}
r0   z*--- Failure #%d%s---
z (pickled) Ú z#{}: {}
*--- End of Failure #{} ---
z  z  exampleLocalVar : "'xyz'"z  exampleLocalVar : 'xyz'zA [Capture of Locals and Globals disabled (use captureVars=True)]
N)r5   r   rr   ÚprintDetailedTracebackÚgetvalueÚcountÚpickledr   r   ÚqualrC   Úsafe_strrS   ro   Ú
splitlinesrc   ÚassertNotEqualÚassertInrB   )
r"   r+   rr   r4   Úoutrm   ÚstartÚendÚlineÚlinesWithVarss
   &&&       r   ÚassertDetailedTracebackÚ$FailureTests.assertDetailedTraceback–   s1  € ôR ¨;Ô7ˆÜ‹jˆßØ�N‰NÔØ	× Ñ  Ô%à�\‰\‹^ˆØ)Ø�G‰GØ�Y‰Y×(Ð(˜=×0Ð0¨Sð-
õ 
ˆð 6×<Ñ<Ü�LŠL˜Ÿ™Ó Ü×Ò˜QŸW™WÓ%Ø�G‰Gó
ˆð
 	×"Ñ" 2¨cÔ2ð +-¯-©-¬/ÓS©/ $¿_¹_ÈT×=RŸ˜©/ˆÐSçØ×Ñ  MÔ2ßØ6‘à2�Ø�M‰M˜$Ö.à×Ñ˜R Ô/Ø�M‰MØWØöùò Ts   Ä FÄFc               ó    € V ^8„  d   QhRRRR/# ©r   r+   r   r   r:   r   )r   s   "r   r   r;   â   s   € ÷ &Gñ &G°ð &GÀñ &Gr   c                óŠ  € V'       d   RpV \        4       p\        4       pVP                  V4       VP                  4       pRpVP                   F  w  rxršpWh RV	 RV R2,          pK  	  \        \        4      pV P                  VRV R2V 4       V'       d)   V P                  \        P                  ! RV4      4       R# R# )	aT  
Assert that L{printBriefTraceback} produces and prints a brief
traceback.

The brief traceback consists of a header::

  Traceback: <type 'exceptions.ZeroDivisionError'>: float division

And the footer::

  /twisted/test/test_failure.py:39:getDivisionFailure

@param captureVars: Enables L{Failure.captureVars}.
@type captureVars: C{bool}
ÚabcdeÚ Ú:Ú
zTraceback: ú: zexampleLocalVar.*abcdeN)r5   r   ÚprintBriefTracebackrv   ÚframesÚreprÚZeroDivisionErrorro   ÚassertIsNoneÚreÚsearch)r"   r+   r3   r4   r~   rm   ÚstackÚmethodÚfilenameÚlinenoÚ	localVarsÚ
globalVarsÚzdes   &&           r   ÚassertBriefTracebackÚ!FailureTests.assertBriefTracebackâ   sÃ   € ÷  Ø%ˆOñ äÓ ˆÜ‹jˆØ	×Ñ˜cÔ"Ø�\‰\‹^ˆØˆØ?@¿x¼xÑ;ˆF˜f°Ø�z  6 (¨!¨F¨8°2Ð6Õ6ŠEñ @Hô Ô$Ó%ˆØ×"Ñ"ØØ˜#˜˜bÐ!Øˆgô	
÷ Ø×ÑœbŸišiÐ(@À"ÓEÖFñ r   c               ó    € V ^8„  d   QhRRRR/# r†   r   )r   s   "r   r   r;   
  s   € ÷ ,Gñ ,G°$ð ,GÀ4ñ ,Gr   c           
     óV  € V'       d   RpV \        VR7      p\        4       pVP                  V4       VP                  4       pRpVP                   FI  w  rxršpVRV RV	 RV R2,          pVR\
        P                  ! W‰4      P                  4        R2,          pKK  	  V P                  VR	V: \        P                  ! VP                  4      : R
\        P                  ! VP                  4      : R24       V'       d)   V P                  \        P                   ! RV4      4       R# R# )a„  
Assert that L{printTraceback} produces and prints a default traceback.

The default traceback consists of a header::

  Traceback (most recent call last):

And the footer::

    File "twisted/test/test_failure.py", line 39, in getDivisionFailure
      1 / 0
    exceptions.ZeroDivisionError: float division

@param captureVars: Enables L{Failure.captureVars}.
@type captureVars: C{bool}
Úxyzzyr0   r‰   z  File "z", line z, in r‹   z    z"Traceback (most recent call last):rŒ   zexampleLocalVar.*xyzzyN)r5   r   ÚprintTracebackrv   rŽ   Ú	linecacheÚgetlineÚstripro   r   ry   rC   rz   rS   r‘   r’   r“   )r"   r+   r3   r4   r~   rm   r”   r•   r–   r—   r˜   r™   s   &&          r   ÚassertDefaultTracebackÚ#FailureTests.assertDefaultTraceback
  s  € ÷" Ø%ˆOñ ä¨;Ô7ˆÜ‹jˆØ	×Ñ˜ÔØ�\‰\‹^ˆØˆØ?@¿x¼xÑ;ˆF˜f°Ø�x ˜z¨°&°¸¸v¸hÀbÐIÕIˆEØ�tœI×-Ò-¨hÓ?×EÑEÓGÐHÈÐKÕKŠEñ @Hð 	×"Ñ"ØØ0ò Ü—’˜QŸV™VÖ$Ü× Ò  §¡Ö)ð	ô		
÷ Ø×ÑœbŸišiÐ(@À"ÓEÖFñ r   c               ó   € V ^8„  d   QhRR/# r9   r   )r   s   "r   r   r;   8  s   € ÷ 'ñ '¨Tñ 'r   c                ó&   € V P                  4        R# )zZ
L{printDetailedTraceback} returns a detailed traceback including the
L{Failure}'s count.
N©rƒ   ©r"   s   &r   Útest_printDetailedTracebackÚ(FailureTests.test_printDetailedTraceback8  s   € ð
 	×$Ñ$Ö&r   c               ó   € V ^8„  d   QhRR/# r9   r   )r   s   "r   r   r;   ?  s   € ÷ $ñ $¨$ñ $r   c                ó&   € V P                  4        R# )z3
L{printBriefTraceback} returns a brief traceback.
N©r›   r©   s   &r   Útest_printBriefTracebackÚ%FailureTests.test_printBriefTraceback?  s   € ð 	×!Ñ!Ö#r   c               ó   € V ^8„  d   QhRR/# r9   r   )r   s   "r   r   r;   E  s   € ÷ &ñ & Tñ &r   c                ó&   € V P                  4        R# )z(
L{printTraceback} returns a traceback.
N©r¤   r©   s   &r   Útest_printTracebackÚ FailureTests.test_printTracebackE  s   € ð 	×#Ñ#Ö%r   c               ó   € V ^8„  d   QhRR/# r9   r   )r   s   "r   r   r;   K  s   € ÷ 7ñ 7¸ñ 7r   c                ó*   € V P                  RR7       R# )z²
L{printDetailedTraceback} captures the locals and globals for its
stack frames and adds them to the traceback, when called on a
L{Failure} constructed with C{captureVars=True}.
Tr0   Nr¨   r©   s   &r   Ú'test_printDetailedTracebackCapturedVarsÚ4FailureTests.test_printDetailedTracebackCapturedVarsK  s   € ð 	×$Ñ$°Ð$Ö6r   c               ó   € V ^8„  d   QhRR/# r9   r   )r   s   "r   r   r;   S  s   € ÷ 4ñ 4°dñ 4r   c                ó*   € V P                  RR7       R# )z¾
L{printBriefTraceback} returns a brief traceback when called on a
L{Failure} constructed with C{captureVars=True}.

Local variables on the stack can not be seen in the resulting
traceback.
Tr0   Nr®   r©   s   &r   Ú$test_printBriefTracebackCapturedVarsÚ1FailureTests.test_printBriefTracebackCapturedVarsS  s   € ð 	×!Ñ!¨dÐ!Ö3r   c               ó   € V ^8„  d   QhRR/# r9   r   )r   s   "r   r   r;   ]  s   € ÷ 6ñ 6°ñ 6r   c                ó*   € V P                  RR7       R# )z³
L{printTraceback} returns a traceback when called on a L{Failure}
constructed with C{captureVars=True}.

Local variables on the stack can not be seen in the resulting
traceback.
Tr0   Nr³   r©   s   &r   Útest_printTracebackCapturedVarsÚ,FailureTests.test_printTracebackCapturedVars]  s   € ð 	×#Ñ#°Ð#Ö5r   c               ó   € V ^8„  d   QhRR/# r9   r   )r   s   "r   r   r;   g  s   € ÷ Jñ JÀñ Jr   c                ó,   € V P                  RRR7       R# )zz
C{printDetailedTraceback} includes information about local variables on
the stack after C{cleanFailure} has been called.
T)r+   rr   Nr¨   r©   s   &r   Ú.test_printDetailedTracebackCapturedVarsCleanedÚ;FailureTests.test_printDetailedTracebackCapturedVarsCleanedg  s   € ð
 	×$Ñ$°ÀDÐ$ÖIr   c               ó   € V ^8„  d   QhRR/# r9   r   )r   s   "r   r   r;   n  s   € ÷ 
ñ 
°ñ 
r   c                óV   € V P                  \        \        P                  RRRR7       R# )z]
L{failure.format_frames} raises a L{ValueError} if the supplied
C{detail} level is unknown.
NÚnoisia©Údetail)rJ   rI   r   Úformat_framesr©   s   &r   Útest_invalidFormatFramesDetailÚ+FailureTests.test_invalidFormatFramesDetailn  s(   € ð
 	×ÑÜœ×-Ñ-¨t°TÀ(ð 	ö 	
r   c               ó   € V ^8„  d   QhRR/# r9   r   )r   s   "r   r   r;   w  s   € ÷ %ñ % $ñ %r   c                	ó¨   € \        4       p\        P                  ! V4      pVP                  \         4       V P	                  VP
                  V4       R # r   )rA   r   r2   r?   rB   rS   )r"   Úer4   s   &  r   Útest_ExplictPassÚFailureTests.test_ExplictPassw  s7   € Ü‹NˆÜ�OŠO˜AÓˆØ	�‰Œ|ÔØ×Ñ˜Ÿ™ !Ö$r   c               ó    € V ^8„  d   QhRRRR/# )r   r4   r-   r   z
str | Noner   )r   s   "r   r   r;   }  s   € ÷ Sñ S¨ð S¸Jñ Sr   c                	óâ   €  VP                  4        \        R 4      h  \         dG    \        P                  ! \
        P                  ! 4       ^,          4      pTR,          P                  u # i ; i)z3f.raiseException() didn't raise ZeroDivisionError!?éÿÿÿÿ)ÚraiseExceptionÚ	Exceptionr�   Ú	tracebackÚ
extract_tbÚsysÚexc_infor�   )r"   r4   rm   s   && r   Ú_getInnermostFrameLineÚ#FailureTests._getInnermostFrameLine}  s\   € ð	SØ×ÑÔô
 ÐQÓRÐRøô	 !ô 	Ü×%Ò%¤c§l¢l£n°QÕ&7Ó8ˆBØ�b•6—;‘;Òð	ús   ‚ �AA.Á-A.c               ó   € V ^8„  d   QhRR/# r9   r   )r   s   "r   r   r;   †  s   € ÷ -ñ -¨4ñ -r   c                	ó`   € \        4       pV P                  V4      pV P                  VR 4       R# )ú1 / 0N)r5   rÜ   rB   )r"   r4   Ú	innerlines   &  r   Útest_RaiseExceptionWithTBÚ&FailureTests.test_RaiseExceptionWithTB†  s*   € ÜÓ ˆØ×/Ñ/°Ó2ˆ	Ø×Ñ˜ GÖ,r   c               ó   € V ^8„  d   QhRR/# r9   r   )r   s   "r   r   r;   ‹  s   € ÷ Lñ L¨ñ Lr   c                ób   € V P                  \        P                  \        P                  4       R# )zÁ
Creating a Failure with no arguments causes it to try to discover the
current interpreter exception state.  If no such state exists, creating
the Failure should raise a synchronous exception.
N)rJ   r   ÚNoCurrentExceptionErrorr2   r©   s   &r   Útest_ConstructionFailsÚ#FailureTests.test_ConstructionFails‹  s   € ð 	×Ñœ'×9Ñ9¼7¿?¹?ÖKr   c               ó   € V ^8„  d   QhRR/# r9   r   )r   s   "r   r   r;   “  s   € ÷ 7ñ 7¨ñ 7r   c                ón   € \        4       pV P                  VP                  4       VP                  4       R# )zƒ
If the C{Failure} has not been cleaned, then C{getTracebackObject}
returns the traceback object that captured in its constructor.
N)r5   rB   ÚgetTracebackObjectrm   ©r"   r4   s   & r   Útest_getTracebackObjectÚ$FailureTests.test_getTracebackObject“  s)   € ô
 Ó ˆØ×Ñ˜×-Ñ-Ó/°·±Ö6r   c               ó   € V ^8„  d   QhRR/# r9   r   )r   s   "r   r   r;   ›  s   € ÷ 
Mñ 
M¸ñ 
Mr   c                óè   €  ^^ ,           V P                  XP	                  4       XP
                  4       R#   \          d0    \        P                  ! 4       p\        P                  ! RR7      p Lei ; i)zK
C{captureVars=True} has no effect on the result of
C{getTracebackObject}.
Tr0   N)r�   r   r2   rB   rë   rm   )r"   ÚnoVarsFailureÚvarsFailures   &  r   Ú&test_getTracebackObjectFromCaptureVarsÚ3FailureTests.test_getTracebackObjectFromCaptureVars›  sX   € ð
	<Ø�ŽEð 	×Ñ˜×9Ñ9Ó;¸[¿^¹^ÖLøô !ô 	<Ü#ŸOšOÓ-ˆMÜ!Ÿ/š/°dÔ;ŠKð	<ús   ‚	7 ·7A1Á0A1c               ó   € V ^8„  d   QhRR/# r9   r   )r   s   "r   r   r;   §  s   € ÷ 
-ñ 
-°$ñ 
-r   c                ó  € \        4       p\        P                  ! VP                  4       4      pVP	                  4        \        P                  ! VP                  4       4      pV P                  V4       V P                  W#4       R# )z
If the Failure has been cleaned, then C{getTracebackObject} returns an
object that looks the same to L{traceback.extract_tb}.
N)r5   rØ   rÙ   rë   rr   ÚassertIsNotNonerB   ©r"   r4   ÚexpectedÚobserveds   &   r   Ú test_getTracebackObjectFromCleanÚ-FailureTests.test_getTracebackObjectFromClean§  sd   € ô
 Ó ˆÜ×'Ò'¨×(<Ñ(<Ó(>Ó?ˆØ	�‰ÔÜ×'Ò'¨×(<Ñ(<Ó(>Ó?ˆØ×Ñ˜XÔ&Ø×Ñ˜Ö,r   c               ó   € V ^8„  d   QhRR/# r9   r   )r   s   "r   r   r;   ³  s   € ÷ 	-ñ 	-Àñ 	-r   c                óð   € \        RR7      p\        P                  ! VP                  4       4      pVP	                  4        \        P                  ! VP                  4       4      pV P                  W#4       R# )z‹
If the Failure was created with captureVars, then C{getTracebackObject}
returns an object that looks the same to L{traceback.extract_tb}.
Tr0   N)r5   rØ   rÙ   rë   rr   rB   rø   s   &   r   Ú.test_getTracebackObjectFromCaptureVarsAndCleanÚ;FailureTests.test_getTracebackObjectFromCaptureVarsAndClean³  sX   € ô
 ¨4Ô0ˆÜ×'Ò'¨×(<Ñ(<Ó(>Ó?ˆØ	�‰ÔÜ×'Ò'¨×(<Ñ(<Ó(>Ó?ˆØ×Ñ˜Ö,r   c               ó   € V ^8„  d   QhRR/# r9   r   )r   s   "r   r   r;   ¾  s   € ÷ 	2ñ 	2¸ñ 	2r   c                ó‚   € \         P                  ! \        R4      4      pV P                  VP	                  4       4       R# )zä
L{failure.Failure}s need not be constructed with traceback objects. If
a C{Failure} has no traceback information at all, C{getTracebackObject}
just returns None.

None is a good value, because traceback.extract_tb(None) -> [].
z
some errorN)r   r2   r×   r‘   rë   rì   s   & r   Ú'test_getTracebackObjectWithoutTracebackÚ4FailureTests.test_getTracebackObjectWithoutTraceback¾  s.   € ô �OŠOœI lÓ3Ó4ˆØ×Ñ˜!×.Ñ.Ó0Ö1r   c               ó   € V ^8„  d   QhRR/# r9   r   )r   s   "r   r   r;   É  s   € ÷  ñ  °dñ  r   c                óÐ   €  ^^ ,           \        P                  ! X4      pV P                  VP                  X4       R#   \          d    \        P                  ! 4       w  rp LYi ; i)z©
If a L{failure.Failure} is constructed with an exception but no
traceback in Python 3, the traceback will be extracted from the
exception's C{__traceback__} attribute.
N)r1   rÚ   rÛ   r   r2   rL   rm   )r"   ÚklassrM   rm   r4   s   &    r   Ú$test_tracebackFromExceptionInPython3Ú1FailureTests.test_tracebackFromExceptionInPython3É  sQ   € ð	2Ø�ŽEô �OŠO˜IÓ&ˆØ�‰�a—d‘d˜BÖøô ô 	2Ü#&§<¢<£>Ñ ˆEšbð	2ús   ‚	? ¿#A%Á$A%c               ó   € V ^8„  d   QhRR/# r9   r   )r   s   "r   r   r;   Ö  s   € ÷ 	1ñ 	1¸Dñ 	1r   c                ó  € \        4       pV P                  VP                  4       V P                  VP                  P
                  VP                  4       VP                  4        V P                  VP                  P
                  4       R# )zn
L{failure.Failure.cleanFailure} sets the C{__traceback__} attribute of
the exception to L{None} in Python 3.
N)r5   r÷   rm   rL   rS   Ú__traceback__rr   r‘   rì   s   & r   Ú*test_cleanFailureRemovesTracebackInPython3Ú7FailureTests.test_cleanFailureRemovesTracebackInPython3Ö  s\   € ô
 Ó ˆØ×Ñ˜QŸT™TÔ"Ø�‰�a—g‘g×+Ñ+¨Q¯T©TÔ2Ø	�‰ÔØ×Ñ˜!Ÿ'™'×/Ñ/Ö0r   c               ó   € V ^8„  d   QhRR/# r9   r   )r   s   "r   r   r;   á  s   € ÷ /ñ /˜Dñ /r   c                ó¤   € \        4       p\        4       p\        VP                  4       VR7       V P	                  RVP                  4       4       R# )zÂ
The traceback captured by a L{Failure} is compatible with the stdlib
L{dis.distb} function as used in post-mortem debuggers. Specifically,
it doesn't cause that function to raise an exception.
)Úfilez --> N)r5   r   r   rë   r}   rv   )r"   r4   Úbufs   &  r   Ú
test_distbÚFailureTests.test_distbá  s<   € ô Ó ˆÜ‹jˆÜˆa×"Ñ"Ó$¨3Õ/ð 	�‰�g˜sŸ|™|›~Ö.r   c               ó   € V ^8„  d   QhRR/# r9   r   )r   s   "r   r   r;   î  s   € ÷ 

ñ 

˜4ñ 

r   c                óŽ   € \        4       p\        P                  ! \        4      pV P	                  \        V4      RV: R24       R# )zk
The C{repr} of a L{failure.Failure} shows the type and string
representation of the underlying exception.
z <twisted.python.failure.Failure z: division by zero>N)r5   r   ÚfullyQualifiedNamer�   rB   r�   )r"   r4   ÚtypeNames   &  r   Ú	test_reprÚFailureTests.test_reprî  s8   € ô
 Ó ˆÜ×-Ò-Ô.?Ó@ˆØ×ÑÜ�ŒGÛJRÐTö	
r   c               ó   € V ^8„  d   QhRR/# r9   r   )r   s   "r   r   r;   ú  s   € ÷ ñ  tñ r   c                óà   € \        4       pVP                  Vn        V P                  4       pV P                  \	        V4      ^8¬  4       VRR  F  pV P                  RVR,          4       K  	  R# )z<
C{Failure.stack} is gettable and settable, but depreacted.
NzFtwisted.python.failure.Failure.stack was deprecated in Twisted 24.10.0Úmessageéþÿÿÿ)r5   r”   ÚflushWarningsrb   ÚlenrB   )r"   r4   ÚwarningsÚws   &   r   Útest_stackDeprecationÚ"FailureTests.test_stackDeprecationú  sb   € ô Ó ˆØ—'‘'ˆŒØ×%Ñ%Ó'ˆØ�‰œ˜H›¨Ñ*Ô+Ø˜"˜#“ˆAØ×ÑØXØ�)•öó r   c               ó   € V ^8„  d   QhRR/# r9   r   )r   s   "r   r   r;     s   € ÷ 'ñ '¨dñ 'r   c                óº  € \        R4      p\        P                  ! V4      P                  P	                  4       p\        P                  P                  V4      pV P                  V\        P                  4       VP                  P	                  4       pV P                  VP                  R4      ^,           VP                  R4      4       V P                  W$4       R# )zM
C{Failure._withoutTraceback(exc)} gives the same result as
C{Failure(exc)}.
Úhellorw   N)	r�   r   r2   Ú__dict__ÚcopyÚ_withoutTracebackÚassertIsInstancerB   Úpop)r"   ÚexcÚdict1Úfailure2Údict2s   &    r   Útest_failureWithoutTracebackÚ)FailureTests.test_failureWithoutTraceback  s    € ô
   Ó(ˆÜ—’ Ó$×-Ñ-×2Ñ2Ó4ˆÜ—?‘?×4Ñ4°SÓ9ˆØ×Ñ˜h¬¯©Ô8Ø×!Ñ!×&Ñ&Ó(ˆð 	×Ñ˜Ÿ™ 7Ó+¨aÕ/°·±¸7Ó1CÔDð 	×Ñ˜Ö&r   c               ó   € V ^8„  d   QhRR/# r9   r   )r   s   "r   r   r;     s   € ÷ 0ñ 0 dñ 0r   c                óP  € \        R4      p\        P                  ! V4      pV P                  V4       \        P                  P	                  V4      pV P                  V4        \        R4      h  \
         d    \        P                  ! 4       p Mi ; iT P                  T4       R# )zU
C{Failure(exc)} and C{Failure._withoutTraceback(exc)} can be pickled
and unpickled.
r'  ÚbooN)r   r   r2   ÚassertPicklingRoundtripsr*  r1   )r"   r-  Úfailure1r/  Úfailure3s   &    r   Útest_failurePicklingÚ!FailureTests.test_failurePickling  s‡   € ô
 " 'Ó*ˆÜ—?’? 3Ó'ˆØ×%Ñ% hÔ/ô
 —?‘?×4Ñ4°SÓ9ˆØ×%Ñ% hÔ/ð	)Ü% eÓ,Ð,øÜô 	)Ü—’Ó(ŠHð	)úà×%Ñ% hÖ/s   Á$A/ Á/ BÂBc               ó    € V ^8„  d   QhRRRR/# )r   Úoriginal_failurer-   r   r:   r   )r   s   "r   r   r;   /  s   € ÷ Cñ C¸ð CÈTñ Cr   c                óD  € \         P                  ! \         P                  ! V4      4      pVP                  P	                  4       p^VR&   RVR&   VP                  P	                  4       pV P                  W44       V P                  VP                  VP                  4       R# )zc
The failure can be pickled and unpickled, and the C{parents} attribute
is included in the pickle.
rx   Nrm   )ÚpickleÚloadsÚdumpsr(  r)  rB   rŽ   )r"   r<  r/  rù   Úresults   &&   r   r6  Ú%FailureTests.assertPicklingRoundtrips/  s€   € ô
 —<’<¤§¢Ð-=Ó >Ó?ˆØ#×,Ñ,×1Ñ1Ó3ˆØˆ�ÑØˆ�‰Ø×"Ñ"×'Ñ'Ó)ˆØ×Ñ˜Ô*Ø×Ñ˜Ÿ™Ð*:×*AÑ*AÖBr   c               ó   € V ^8„  d   QhRR/# r9   r   )r   s   "r   r   r;   <  s   € ÷ Añ A°Tñ Ar   c                ó¦   € \         P                  ! \        R4      4      pV P                  VP	                  4       R,          VP
                  4       R# )z/
C{Failure.parents} is included in the pickle.
r'  ÚparentsN)r   r2   r   rB   Ú__getstate__rE  rì   s   & r   Ú#test_failurePicklingIncludesParentsÚ0FailureTests.test_failurePicklingIncludesParents<  s8   € ô �OŠOÔ/°Ó8Ó9ˆØ×Ñ˜Ÿ™Ó)¨)Õ4°a·i±iÖ@r   c               ó   € V ^8„  d   QhRR/# r9   r   )r   s   "r   r   r;   C  s   € ÷ Hñ H Tñ Hr   c                ó@  € \         P                  ! \        4       4      pVP                  R,          Vn        \        P
                  ! \        P                  ! V4      4      pVP                  RR Vn        V P                  VP                  VP                  RR 4       R# )z?
C{Failure.frames} can be set, both before and after pickling.
ºNNNNrÕ   )r   r2   r5   rŽ   r>  r?  r@  rB   ©r"   r<  r/  s   &  r   Útest_settableFramesÚ FailureTests.test_settableFramesC  sw   € ô #Ÿ?š?Ô+=Ó+?Ó@ÐØ"2×"9Ñ"9¸!Õ"<ÐÔÜ—<’<¤§¢Ð-=Ó >Ó?ˆØ"Ÿ/™/¨#¨2Ð.ˆŒØ×Ñ˜Ÿ™Ð*:×*AÑ*AÀ#À2Ð*FÖGr   c               ó   € V ^8„  d   QhRR/# r9   r   )r   s   "r   r   r;   M  s   € ÷ 	/ñ 	/ dñ 	/r   c                óø   € \         P                  ! \        R4      4      pVP                  R,          Vn        \        P
                  ! \        P                  ! V4      4      pVP                  R,          Vn        R# )z[
C{Failure.parents} can be set, both before and after pickling.

This is used by Foolscap.
r'  rK  N)r   r2   r   rE  r>  r?  r@  rL  s   &  r   Útest_settableParentsÚ!FailureTests.test_settableParentsM  sX   € ô #Ÿ?š?Ô+>¸wÓ+GÓHÐØ#3×#;Ñ#;¸AÕ#>ÐÔ Ü—<’<¤§¢Ð-=Ó >Ó?ˆØ#×+Ñ+¨AÕ.ˆÖr   r   N)FF)F),r%   r&   r'   r(   r)   rE   rO   rW   r[   rd   rj   ro   rƒ   r›   r¤   rª   r¯   r´   r¸   r¼   rÀ   rÄ   rÌ   rÑ   rÜ   râ   rç   rí   ró   rû   rÿ   r  r  r  r  r  r#  r1  r9  r6  rG  rM  rQ  r*   r   r   r   r7   r7   6   sÙ   † ñõ
6õ,õ	+õ+õ 	Wõ	Sõ(÷J÷X&G÷P,Gõ\'õ$õ&õ7õ4õ6õJõ
õ%õSõ-õ
Lõ7õ
Mõ
-õ	-õ	2õ õ	1õ/õ

õõ'õ"0õ,CõAõH÷	/ñ 	/r   r7   c                  ó&   € ] tR tRtRtR R ltRtR# )Ú	BrokenStriY  zV
An exception class the instances of which cannot be presented as strings
via L{str}.
c               ó   € V ^8„  d   QhRR/# ©r   r   r_   r   )r   s   "r   r   ÚBrokenStr.__annotate___  s   € ÷ ñ ˜ñ r   c                	ó   € V hr   r   r©   s   &r   Ú__str__ÚBrokenStr.__str___  s   € àˆ
r   r   N©r%   r&   r'   r(   r)   rY  r*   r   r   r   rT  rT  Y  s   † ñ÷
ñ r   rT  c                  ó&   € ] tR tRtRtR R ltRtR# )ÚBrokenExceptionMetaclassid  zU
A metaclass for an exception type which cannot be presented as a string via
L{str}.
c               ó   € V ^8„  d   QhRR/# rV  r   )r   s   "r   r   Ú%BrokenExceptionMetaclass.__annotate__j  s   € ÷ @ñ @˜ñ @r   c                	ó   € \        R 4      h)z#You cannot make a string out of me.)rI   r©   s   &r   rY  Ú BrokenExceptionMetaclass.__str__j  s   € ÜÐ>Ó?Ð?r   r   Nr[  r   r   r   r]  r]  d  s   † ñ÷
@ñ @r   r]  c                  ó   € ] tR tRtRtRtR# )ÚBrokenExceptionTypein  zU
The aforementioned exception type which cannot be presented as a string via
L{str}.
r   N)r%   r&   r'   r(   r)   r*   r   r   r   rc  rc  n  s   † õr   rc  )Ú	metaclassc                  óz   € ] tR tRtRtR R ltR R ltR R ltR	 R
 ltR R lt	R R lt
R R ltR R ltRtR# )ÚGetTracebackTestsiv  z$
Tests for L{Failure.getTraceback}.
c               ó    € V ^8„  d   QhRRRR/# ©r   rÊ   r_   r   r:   r   )r   s   "r   r   ÚGetTracebackTests.__annotate__{  s   € ÷ 	.ñ 	. sð 	.¨tñ 	.r   c                ó–   € \        4       p\        P                  ! V4      pVP                  VR7      pV P	                  V\
        4       R# )z»
Construct a L{Failure} with an exception that raises an exception from
its C{__str__} method and then call C{getTraceback} with the specified
detail and verify that it returns a string.
rÉ   N)rT  r   r2   ÚgetTracebackr+  r_   )r"   rÊ   Úxr4   rØ   s   &&   r   Ú_brokenValueTestÚ"GetTracebackTests._brokenValueTest{  s9   € ô ‹KˆÜ�OŠO˜AÓˆØ—N‘N¨&�NÓ1ˆ	Ø×Ñ˜i¬Ö-r   c               ó   € V ^8„  d   QhRR/# r9   r   )r   s   "r   r   ri  †  s   € ÷ 'ñ '¨Tñ 'r   c                ó(   € V P                  R4       R# )zÈ
A L{Failure} might wrap an exception with a C{__str__} method which
raises an exception.  In this case, calling C{getTraceback} on the
failure with the C{"brief"} detail does not raise an exception.
ÚbriefN©rm  r©   s   &r   Útest_brokenValueBriefDetailÚ-GetTracebackTests.test_brokenValueBriefDetail†  s   € ð 	×Ñ˜gÖ&r   c               ó   € V ^8„  d   QhRR/# r9   r   )r   s   "r   r   ri  Ž  ó   € ÷ )ñ )¨tñ )r   c                ó(   € V P                  R4       R# )úI
Like test_brokenValueBriefDetail, but for the C{"default"} detail case.
ÚdefaultNrr  r©   s   &r   Útest_brokenValueDefaultDetailÚ/GetTracebackTests.test_brokenValueDefaultDetailŽ  ó   € ð 	×Ñ˜iÖ(r   c               ó   € V ^8„  d   QhRR/# r9   r   )r   s   "r   r   ri  ”  rv  r   c                ó(   € V P                  R4       R# )rx  ÚverboseNrr  r©   s   &r   Útest_brokenValueVerboseDetailÚ/GetTracebackTests.test_brokenValueVerboseDetail”  r|  r   c               ó    € V ^8„  d   QhRRRR/# rh  r   )r   s   "r   r   ri  š  s   € ÷ .ñ . cð .¨dñ .r   c                ó’   € \         P                  ! \        4       4      pVP                  VR7      pV P	                  V\
        4       R# )zÀ
Construct a L{Failure} with an exception type that raises an exception
from its C{__str__} method and then call C{getTraceback} with the
specified detail and verify that it returns a string.
rÉ   N)r   r2   rc  rk  r+  r_   )r"   rÊ   r4   rØ   s   &&  r   Ú_brokenTypeTestÚ!GetTracebackTests._brokenTypeTestš  s6   € ô �OŠOÔ/Ó1Ó2ˆØ—N‘N¨&�NÓ1ˆ	Ø×Ñ˜i¬Ö-r   c               ó   € V ^8„  d   QhRR/# r9   r   )r   s   "r   r   ri  ¤  s   € ÷ 	&ñ 	&¨Dñ 	&r   c                ó(   € V P                  R4       R# )a  
        A L{Failure} might wrap an
        newPublisher(evt)
xception the type object of which has a
        C{__str__} method which raises an exception.  In this case, calling
        C{getTraceback} on the failure with the C{"brief"} detail does not raise
        an exception.
rq  N©r„  r©   s   &r   Útest_brokenTypeBriefDetailÚ,GetTracebackTests.test_brokenTypeBriefDetail¤  s   € ð 	×Ñ˜WÖ%r   c               ó   € V ^8„  d   QhRR/# r9   r   )r   s   "r   r   ri  ¯  ó   € ÷ (ñ (¨dñ (r   c                ó(   € V P                  R4       R# )zH
Like test_brokenTypeBriefDetail, but for the C{"default"} detail case.
ry  Nrˆ  r©   s   &r   Útest_brokenTypeDefaultDetailÚ.GetTracebackTests.test_brokenTypeDefaultDetail¯  ó   € ð 	×Ñ˜YÖ'r   c               ó   € V ^8„  d   QhRR/# r9   r   )r   s   "r   r   ri  µ  rŒ  r   c                ó(   € V P                  R4       R# )zH
Like test_brokenTypeBriefDetail, but for the C{"verbose"} detail case.
r  Nrˆ  r©   s   &r   Útest_brokenTypeVerboseDetailÚ.GetTracebackTests.test_brokenTypeVerboseDetailµ  r�  r   r   N)r%   r&   r'   r(   r)   rm  rs  rz  r€  r„  r‰  rŽ  r“  r*   r   r   r   rf  rf  v  s4   † ñõ	.õ'õ)õ)õ.õ	&õ(÷(ñ (r   rf  c                  óB   € ] tR tRtRt]! ]RJ R4      R R l4       tRtR# )ÚFindFailureTestsi¼  z@
Tests for functionality related to identifying the C{Failure}.
Nzraiser extension not availablec               ó   € V ^8„  d   QhRR/# r9   r   )r   s   "r   r   ÚFindFailureTests.__annotate__Â  s   € ÷ >ñ >Àñ >r   c                ó  €  \         P                  ! 4        V P                  R4       R#   \         P                   dH    \        P
                  ! 4       pT P                  TP                  \         P                  4      4        R# i ; i)z¼
Pyrex and Cython are known to insert fake stack frames so as to give
more Python-like tracebacks. These stack frames with empty code objects
should not break extraction of the exception.
z$No exception raised from extension?!N)r   rÖ   ÚfailÚRaiserExceptionr   r2   rb   Úcheckrì   s   & r   Ú/test_failureConstructionWithMungedStackSucceedsÚ@FindFailureTests.test_failureConstructionWithMungedStackSucceedsÁ  s`   € ð	>Ü×!Ò!Ô#ð
 �I‰IÐ<Ö=øô	 ×%Ñ%ô 	=Ü—’Ó!ˆAØ�O‰O˜AŸG™G¤F×$:Ñ$:Ó;×<ð	=ús   ‚* ªABÂBr   )	r%   r&   r'   r(   r)   r   r   r�  r*   r   r   r   r–  r–  ¼  s'   † ññ ˆF�dˆNÐ<Ó=ô>ó >ô>r   r–  c          
     ó,   € V ^8„  d   QhRRRRRRRRRR	/# )
r   Úfnr_   r—   ÚintÚnameÚtextr:   r   r   r   )r   s   "r   r   r   Õ  s/   € ÷ *ñ *ˆCð *˜ð * Cð *¨tð *¸ñ *r   c                ó   € \        WV4      # r   r   )r   r—   r¢  r£  s   &&&&r   Ú_tbr¥  Õ  s   € Ü˜ DÓ)Ð)r   c                  ó2   € ] tR tRtRtR R ltR R ltRtR# )	ÚFormattableTracebackTestsiÙ  zò
Whitebox tests that show that L{failure._Traceback} constructs objects that
can be used by L{traceback.extract_tb}.

If the objects can be used by L{traceback.extract_tb}, then they can be
formatted using L{traceback.format_tb} and friends.
c               ó   € V ^8„  d   QhRR/# r9   r   )r   s   "r   r   Ú&FormattableTracebackTests.__annotate__â  s   € ÷ 
ñ 
 $ñ 
r   c           	     ó¤   € \         P                  ! RR^{/ / ..4      pV P                  \        P                  ! V4      \        R^{RR4      .4       R# )zÌ
A C{_Traceback} object constructed with a single frame should be able
to be passed to L{traceback.extract_tb}, and we should get a singleton
list containing a (filename, lineno, methodname, line) tuple.
r•   úfilename.pyN)r   Ú
_TracebackrB   rØ   rÙ   r¥  ©r"   rm   s   & r   Útest_singleFrameÚ*FormattableTracebackTests.test_singleFrameâ  sP   € ô ×Ò (¨M¸3ÀÀBÐ!GÐ HÓIˆð 	×ÑÜ× Ò  Ó$¤s¨=¸#¸xÈÓ'NÐ&Oö	
r   c               ó   € V ^8„  d   QhRR/# r9   r   )r   s   "r   r   r©  ð  s   € ÷ 
ñ 
 ñ 
r   c           
     óD  € \         P                  ! RR^{/ / .RR^ë/ / ..4      pV P                  \        P                  ! V4      \        R^{RR4      \        R^ëRR4      .4       V P                  \        P                  ! VP                  4      \        R^{RR4      .4       R# )z­
A C{_Traceback} object constructed with multiple frames should be able
to be passed to L{traceback.extract_tb}, and we should get a list
containing a tuple for each frame.
Úmethod1r«  Úmethod2N)r   r¬  rB   rØ   rÙ   r¥  Úextract_stackÚtb_framer­  s   & r   Útest_manyFramesÚ)FormattableTracebackTests.test_manyFramesð  s©   € ô ×Òà˜M¨3°°BÐ7Ø˜M¨3°°BÐ7ðó
ˆð 	×ÑÜ× Ò  Ó$ä�M 3¨	°4Ó8Ü�M 3¨	°4Ó8ðô	
ð 	×ÑÜ×#Ò# B§K¡KÓ0ä�M 3¨	°4Ó8ðö	
r   r   N)r%   r&   r'   r(   r)   r®  r¶  r*   r   r   r   r§  r§  Ù  s   † ñõ
÷
ñ 
r   r§  c                  ó>   € ] tR tRtRtR R ltR R ltR R ltR	tR
# )ÚFakeAttributesTestsi  a:  
_Frame, _Code and _TracebackFrame objects should possess some basic
attributes that qualify them as fake python objects, allowing the return of
_Traceback to be used as a fake traceback. The attributes that have zero or
empty values are there so that things expecting them find them (e.g. post
mortem debuggers).
c               ó   € V ^8„  d   QhRR/# r9   r   )r   s   "r   r   Ú FakeAttributesTests.__annotate__  s   € ÷ #9ñ #9¨$ñ #9r   c                óz  € \         P                  ! RR4      pR^*/pR^d/p\         P                  ! RR^*VV3V4      pV P                  VP                  V4       V P                  VP                  V4       V P                  VP                  \         P                  4       V P                  VP                  V4       V P                  VP                  \        4       V P                  VP                  \        4       V P                  VP                  ^*4       V P                  VP                  \        R4      4       R# )z°
L{_Frame} instances have the C{f_globals} and C{f_locals} attributes
bound to C{dict} instance.  They also have the C{f_code} attribute
bound to something like a code object.
NÚ	local_varÚ
global_varÚ	dummynameÚdummyfilename)ÚdummyparentÚdummyparentfileéo   NN)r   Ú_FramerB   Ú	f_globalsÚf_localsr+  Úf_codeÚ_CodeÚf_backÚ
f_builtinsÚdictÚf_lastir¡  Úf_linenoÚf_tracerC   )r"   Ú
back_frameÚfake_localsÚfake_globalsÚframes   &    r   Útest_fakeFrameAttributesÚ,FakeAttributesTests.test_fakeFrameAttributes  s  € ô —^’^ðð ó	
ˆ
ð # BÐ'ˆØ$ cÐ*ˆÜ—’àØØØØðð ó	
ˆð 	×Ñ˜Ÿ™¨,Ô7Ø×Ñ˜Ÿ™¨Ô5Ø×Ñ˜eŸl™l¬G¯M©MÔ:Ø×Ñ˜Ÿ™ zÔ2Ø×Ñ˜e×.Ñ.´Ô5Ø×Ñ˜eŸm™m¬SÔ1Ø×Ñ˜Ÿ™¨Ô,Ø×Ñ˜eŸm™m¬T°$«ZÖ8r   c               ó   € V ^8„  d   QhRR/# r9   r   )r   s   "r   r   r»  ;  s   € ÷ :ñ :¨ñ :r   c                ól  € \         P                  ! RR4      pV P                  VP                  R4       V P                  VP                  R4       V P                  VP                  \        4       V P                  VP                  \        4       V P                  VP                  \        4       V P                  VP                  \        4       V P                  VP                  \        4       V P                  VP                  \        4       V P                  VP                  \        4       V P                  VP                   \        4       V P                  VP"                  \        4       V P                  VP$                  \        4       V P                  VP&                  \        4       V P                  VP(                  \        4       V P                  VP*                  \        4       V P                  VP,                  \.        4       V P                  VP1                  4       \        4       R# )ú>
See L{FakeAttributesTests} for more details about this test.
r¿  rÀ  N)r   rÈ  rB   Úco_nameÚco_filenamer+  Úco_argcountr¡  Úco_codeÚbytesÚco_cellvarsÚtupleÚ	co_constsÚco_firstlinenoÚco_flagsÚ	co_lnotabÚco_freevarsÚco_posonlyargcountÚco_kwonlyargcountÚco_namesÚ
co_nlocalsÚco_stacksizeÚco_varnamesÚlistÚco_positions)r"   Úcodes   & r   Útest_fakeCodeAttributesÚ+FakeAttributesTests.test_fakeCodeAttributes;  s  € ô �}Š}˜[¨/Ó:ˆØ×Ñ˜Ÿ™ {Ô3Ø×Ñ˜×)Ñ)¨?Ô;Ø×Ñ˜d×.Ñ.´Ô4Ø×Ñ˜dŸl™l¬EÔ2Ø×Ñ˜d×.Ñ.´Ô6Ø×Ñ˜dŸn™n¬eÔ4Ø×Ñ˜d×1Ñ1´3Ô7Ø×Ñ˜dŸm™m¬SÔ1Ø×Ñ˜dŸn™n¬eÔ4Ø×Ñ˜d×.Ñ.´Ô6Ø×Ñ˜d×5Ñ5´sÔ;Ø×Ñ˜d×4Ñ4´cÔ:Ø×Ñ˜dŸm™m¬UÔ3Ø×Ñ˜dŸo™o¬sÔ3Ø×Ñ˜d×/Ñ/´Ô5Ø×Ñ˜d×.Ñ.´Ô5Ø×Ñ˜d×/Ñ/Ó1´5Ö9r   c               ó   € V ^8„  d   QhRR/# r9   r   )r   s   "r   r   r»  R  s   € ÷ =ñ =¨ñ =r   c                óP  € \         P                  ! RR^*/ / 3R4      p\         P                  ! V4      pV P                  VP                  V4       V P                  VP
                  ^*4       V P                  VP                  \        4       V P                  \        VR4      4       R# )r×  r¿  rÀ  NÚtb_next)r   rÄ  Ú_TracebackFramerB   rµ  Ú	tb_linenor+  Útb_lastir¡  rb   Úhasattr)r"   rÒ  Útraceback_frames   &  r   Útest_fakeTracebackFrameÚ+FakeAttributesTests.test_fakeTracebackFrameR  sŠ   € ô —’Ø˜/¨2¨r°2Ð6Øó
ˆô "×1Ò1°%Ó8ˆØ×Ñ˜×1Ñ1°5Ô9Ø×Ñ˜×2Ñ2°BÔ7Ø×Ñ˜o×6Ñ6¼Ô<Ø�‰œ °Ó;Ö<r   r   N)	r%   r&   r'   r(   r)   rÓ  rí  r÷  r*   r   r   r   r¹  r¹    s   † ñõ#9õJ:÷.=ñ =r   r¹  c                  ó>   € ] tR tRtRtR R ltR R ltR R ltR	tR
# )ÚDebugModeTestsia  z>
Failure's debug mode should allow jumping into the debugger.
c               ó   € V ^8„  d   QhRR/# r9   r   )r   s   "r   r   ÚDebugModeTests.__annotate__f  s   € ÷ !ñ !�tñ !r   c                óú   a aa€ \         P                  o\        P                  P                  oR VV3R llpS P                  V4       . S n        RR V 3R lllpV\         n        \        P                  ! 4        R# )z;
Override pdb.post_mortem so we can make sure it's called.
c               ó   € V ^8„  d   QhRR/# r9   r   )r   s   "r   r   Ú*DebugModeTests.setUp.<locals>.__annotate__n  s   € ÷ 	0ñ 	0˜ñ 	0r   c                 óH   <€ S\         n        S \        P                  n        R # r   )ÚpdbÚpost_mortemr   r2   Ú__init__)ÚorigInitr  s   €€r   ÚrestoreÚ%DebugModeTests.setUp.<locals>.restoren  s   ø€ Ø)ŒCŒOØ'/ŒG�O‰OÖ$r   Nc               ó    € V ^8„  d   QhRRRR/# )r   ÚtzTracebackType | Noner   r:   r   )r   s   "r   r   rÿ  v  s   € ÷ 	"ñ 	"Ð#7ð 	"À4ñ 	"r   c                ó>   <€ SP                   P                  V 4       R # r   )rA  Úappend)r  r"   s   &€r   Úlogging_post_mortemÚ1DebugModeTests.setUp.<locals>.logging_post_mortemv  s   ø€ Ø�K‰K×Ñ˜qÖ!r   r   )r  r  r   r2   r  Ú
addCleanuprA  ÚstartDebugMode)r"   r  r  r  r  s   f  @@r   ÚsetUpÚDebugModeTests.setUpf  s[   ú€ ô
 —o‘oˆÜ—?‘?×+Ñ+ˆ÷	0ñ 	0ð 	�‰˜Ô à24ˆŒ÷	"ò 	"ð .ŒŒÜ×ÒÖ r   c               ó   € V ^8„  d   QhRR/# r9   r   )r   s   "r   r   rü  |  s   € ÷ (ñ ( Tñ (r   c                ó  €  ^^ ,           V P                  V P                  X.4       V P                  XP                  4       R#   \          d1    \        P                  ! 4       w  rp\        P                  ! 4       p Lti ; i)zf
If startDebugMode() is called, calling Failure() will first call
pdb.post_mortem with the traceback.
N)	r1   rÚ   rÛ   r   r2   rB   rA  ÚassertFalser+   ©r"   Útypr-  rm   r4   s   &    r   Útest_regularFailureÚ"DebugModeTests.test_regularFailure|  sd   € ð
	"Ø�ŽEð 	×Ñ˜Ÿ™ r dÔ+Ø×Ñ˜Ÿ™Ö'øô	 ô 	"ÜŸ<š<›>‰LˆC�bÜ—’Ó!ŠAð	"ús   ‚	A Á8B Á?B c               ó   € V ^8„  d   QhRR/# r9   r   )r   s   "r   r   rü  ‰  s   € ÷ 'ñ ' $ñ 'r   c                ó
  €  ^^ ,           V P                  V P                  X.4       V P                  XP                  4       R#   \          d3    \        P                  ! 4       w  rp\        P                  ! RR7      p Lvi ; i)zS
If startDebugMode() is called, passing captureVars to Failure() will
not blow up.
Tr0   N)	r1   rÚ   rÛ   r   r2   rB   rA  rb   r+   r  s   &    r   Útest_captureVarsÚDebugModeTests.test_captureVars‰  sd   € ð
	2Ø�ŽEð 	×Ñ˜Ÿ™ r dÔ+Ø�‰˜Ÿ™Ö&øô	 ô 	2ÜŸ<š<›>‰LˆC�bÜ—’¨DÔ1ŠAð	2ús   ‚	A Á:BÂB)rA  N)	r%   r&   r'   r(   r)   r  r  r  r*   r   r   r   rú  rú  a  s   † ñõ!õ,(÷'ñ 'r   rú  c                  óV   € ] tR tRtRtR R ltR R ltR R ltR	 R
 ltR R lt	Rt
R# )ÚExtendedGeneratorTestsi—  zM
Tests C{failure.Failure} support for generator features added in Python 2.5
c               ó$   € V ^8„  d   QhRRRRRR/# )r   r4   r-   ÚgzGenerator[Any, Any, Any]r   r:   r   )r   s   "r   r   Ú#ExtendedGeneratorTests.__annotate__œ  s)   € ÷ Yñ YØ ðYØ%=ðYà	ñYr   c                	óp   €  VP                  V4       V P                  R 4       R#   \         d     R# i ; i)z<throwExceptionIntoGenerator should have raised StopIterationN)ÚthrowExceptionIntoGeneratorrš  ÚStopIteration)r"   r4   r  s   &&&r   Ú_throwIntoGeneratorÚ*ExtendedGeneratorTests._throwIntoGeneratorœ  s9   € ð	YØ×)Ñ)¨!Ô,ð �I‰IÐWÖXøô ô 	Úð	ús   ‚& ¦5´5c               ó   € V ^8„  d   QhRR/# r9   r   )r   s   "r   r   r   ¦  s   € ÷ Mñ M°$ñ Mr   c                ó�  a a€ . oR V V3R llpV! 4       p\        4       p\        V4       S P                  W24       S P                  S^ ,          ^ ,          \        4       S P                  S^ ,          ^,          \        4       S P                  \        P                  ! S^ ,          ^,          4      R,          R,          R4       R# )zZ
It should be possible to throw the exception that a Failure
represents into a generator.
c               ó   € V ^8„  d   QhRR/# ©r   r   zGenerator[None, None, None]r   )r   s   "r   r   ÚMExtendedGeneratorTests.test_throwExceptionIntoGenerator.<locals>.__annotate__­  s   € ÷ 	Bñ 	BÐ6ñ 	Br   c               3  ó¨   <"  €  R x € S P                  R4       R #   \         d)    SP                  \        P                  ! 4       4        R # i ; i5i)Nz$Yield should have yielded exception.)rš  r1   r
  rÚ   rÛ   )r"   Ústuffs   €€r   Ú	generatorÚJExtendedGeneratorTests.test_throwExceptionIntoGenerator.<locals>.generator­  s@   øé € ðBÛð —	‘	Ð@ÖAøô !ô -Ø—‘œSŸ\š\›^×,ð-üó%   ƒA… ‰Aœ/AÁAÁAÁArà   NrÕ   )r5   Únextr$  rB   r�   r+  rØ   rÙ   )r"   r-  r  r4   r,  s   f   @r   Ú test_throwExceptionIntoGeneratorÚ7ExtendedGeneratorTests.test_throwExceptionIntoGenerator¦  s›   ù€ ð
 ˆ÷	Bñ 	Bñ ‹KˆÜÓ ˆÜˆQŒØ× Ñ  Ô&à×Ñ˜˜q� !�Ô&7Ô8Ø×Ñ˜e A�h q�kÔ+<Ô=à×Ñœ×-Ò-¨e°A­h°q­kÓ:¸2Õ>¸rÕBÀGÖLr   c               ó   € V ^8„  d   QhRR/# r9   r   )r   s   "r   r   r   ¿  s   € ÷ "8ñ "8¸dñ "8r   c                ó(  a a€ \        4       pVP                  4        VP                  4       p. oR VV 3R llpV! 4       p\        V4       S P	                  W4       S P                  \        S4      ^4       S P                  W!P                  4       4       S P                  S^ ,          P                  4       VP                  4       4       S P                  RS^ ,          P                  4       4       S P                  RVP                  4       4       R# )zÇ
When a Failure is constructed in the context of an exception
handler that is handling an exception raised by
throwExceptionIntoGenerator, the new Failure should be chained to that
original Failure.
c               ó   € V ^8„  d   QhRR/# r)  r   )r   s   "r   r   ÚYExtendedGeneratorTests.test_failureConstructionFindsOriginalFailure.<locals>.__annotate__Ì  s   € ÷ 	<ñ 	<Ð6ñ 	<r   c               3  ó¨   <"  €  R x € SP                  R4       R #   \         d)    S P                  \        P                  ! 4       4        R # i ; i5i)NzNo exception sent to generator)rš  r1   r
  r   r2   )ÚnewFailuresr"   s   €€r   r-  ÚVExtendedGeneratorTests.test_failureConstructionFindsOriginalFailure.<locals>.generatorÌ  sB   øé € ð<Ûð —	‘	Ð:Ö;øô !ô 6Ø×"Ñ"¤7§?¢?Ó#4×5ð6ür/  r-  N)
r5   rr   rk  r0  r$  rB   r   r|   r}   ÚassertNotIn)r"   r4   Úoriginal_failure_strr-  r  r8  s   f    @r   Ú,test_failureConstructionFindsOriginalFailureÚCExtendedGeneratorTests.test_failureConstructionFindsOriginalFailure¿  sÖ   ù€ ô Ó ˆØ	�‰ÔØ Ÿ~™~Ó/Ðàˆ÷	<ñ 	<ñ ‹KˆÜˆQŒØ× Ñ  Ô&à×Ñœ˜[Ó)¨1Ô-ð 	×ÑÐ-¯~©~Ó/?Ô@ð 	×Ñ˜K¨�N×7Ñ7Ó9¸1¿>¹>Ó;KÔLØ�‰�k ;¨q¥>×#>Ñ#>Ó#@ÔAØ×Ñ˜ a§n¡nÓ&6Ö7r   c               ó   € V ^8„  d   QhRR/# r9   r   )r   s   "r   r   r   ã  s   € ÷ 'ñ '°$ñ 'r   c                ót   a € R V 3R llpV! 4       p\        V4       \        4       pS P                  W24       R# )zš
When a generator reraises a different exception, creating a L{Failure}
inside the generator should find the reraised exception rather than
original one.
c               ó   € V ^8„  d   QhRR/# r)  r   )r   s   "r   r   ÚMExtendedGeneratorTests.test_ambiguousFailureInGenerator.<locals>.__annotate__ê  s   € ÷ 	Kñ 	KÐ6ñ 	Kr   c               3  óÜ   <"  €   R x € R #   \          d    . ^,            R # i ; i  \          d8    S P                  \        P                  ! 4       P                  \
        4        R # i ; i5ir   )r1   r+  r   r2   rS   Ú
IndexErrorr©   s   €r   r-  ÚJExtendedGeneratorTests.test_ambiguousFailureInGenerator.<locals>.generatorê  sX   øé € ðKðÝøÜ$ô Ø�q—E‘Eðûä ô KØ×%Ñ%¤g§o¢oÓ&7×&=Ñ&=¼z×JðKüs:   ƒA,† ŠA,Œ$ ' ¡A,£$¤' §>A)Á%A,Á(A)Á)A,N)r0  r5   r$  ©r"   r-  r  r4   s   f   r   Ú test_ambiguousFailureInGeneratorÚ7ExtendedGeneratorTests.test_ambiguousFailureInGeneratorã  s5   ø€ ÷	Kð 	Kñ ‹KˆÜˆQŒÜÓ ˆØ× Ñ  Ö&r   c               ó   € V ^8„  d   QhRR/# r9   r   )r   s   "r   r   r   ø  s   € ÷ Gñ G°Dñ Gr   c                óø   € R R lpV! 4       p\        V4       \        4       p V P                  W24       R#   \         d8    T P	                  \
        P                  ! 4       P                  \        4        R# i ; i)z™
When a generator reraises a different exception, creating a L{Failure}
above the generator should find the reraised exception rather than
original one.
c               ó   € V ^8„  d   QhRR/# r)  r   )r   s   "r   r   ÚOExtendedGeneratorTests.test_ambiguousFailureFromGenerator.<locals>.__annotate__ÿ  s   € ÷ 	ñ 	Ð6ñ 	r   c               3  óN   "  €  R x € R #   \          d    . ^,            R # i ; i5ir   )r1   r   r   r   r-  ÚLExtendedGeneratorTests.test_ambiguousFailureFromGenerator.<locals>.generatorÿ  s$   é € ðÝøÜ ô Ø�1—‘ðüs   ‚%„
 ˆ%Š"ž%¡"¢%N)	r0  r5   r$  r1   r+  r   r2   rS   rC  rE  s   &   r   Ú"test_ambiguousFailureFromGeneratorÚ9ExtendedGeneratorTests.test_ambiguousFailureFromGeneratorø  sa   € õ	ñ ‹KˆÜˆQŒÜÓ ˆð	GØ×$Ñ$ QÖ*øÜô 	GØ×!Ñ!¤'§/¢/Ó"3×"9Ñ"9¼:×Fð	Gús   ¤7 ·>A9Á8A9r   N)r%   r&   r'   r(   r)   r$  r1  r<  rF  rN  r*   r   r   r   r  r  —  s*   † ñõYõMõ2"8õH'÷*Gñ Gr   r  ),r)   Ú
__future__r   r¡   r  r>  r’   rÚ   rØ   Údisr   Úior   r   Útypesr   Útypingr   r	   r
   Úunittestr   Úcython_test_exception_raiserr   Útwisted.pythonr   r   Útwisted.trial.unittestr   r×   r   r5   r7   rT  rC   r]  rc  rf  r–  r¥  r§  r¹  rú  r  r   r   r   Ú<module>rY     sï   ðñõ #ã Û 
Û Û 	Û 
Û Ý Ý Ý "Ý ß 'Ñ 'Ý å /ç +Ý 6ô
˜)ô 
ð¨e÷ ô"`/Ð&ô `/ôF�	ô ô@˜tô @ô˜)Ð/Gõ ôC(Ð+ô C(ôL>Ð*ô >õ2*ô1
Ð 3ô 1
ôhQ=Ð-ô Q=ôh3'Ð(ô 3'ôltGÐ0ö tGr   