+
    Biw                     l   R t RtRt^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RI	H
t
HtHt R tR t ! R R	]
4      tR
 t ! R R]4      t]R 4       t ! R R]4      t ! R R]4      t ! R R]P,                  4      t ! R R]4      t ! R R]P,                  ]4      t ! R R]P,                  ]4      t ! R R]]P,                  4      t ! R R]P,                  4      t ! R R]P,                  4      t ! R  R!]P,                  4      t ! R" R#]P,                  4      t] R$8X  d   ]PB                  ! 4        R# R# )%zIUnit tests for the 'with/async with' statements specified in PEP 343/492.z
Mike Blandzmbland at acm dot orgN)deque)_GeneratorContextManagercontextmanagernullcontextc                 V    V ;_uu_ 4         R R R 4       R #   + '       g   i     R # ; iN objs   &%/usr/lib/python3.14/test/test_with.pydo_withr      s    	 
s   (	c                    "   T ;_uu_4       GR j  xL
   R R R 4      GR j  xL
  R #  L L  + GR j  xL 
 '       g   i     R # ; i5ir   r   r	   s   &r   do_async_withr      s     ss ssssss>   A
)A
-A
+A
A
A	6
A	A		A
c                   >   a a ] tR t^t oV 3R ltR tR tRtVtV ;t	# )MockContextManagerc                N   < \         SV `  ! V!   R V n        R V n        RV n        R# FN)super__init__enter_calledexit_called	exit_args)selfargs	__class__s   &*r   r   MockContextManager.__init__   s'    $!     c                <    R V n         \        P                  ! V 4      # T)r   r   	__enter__r   s   &r   r   MockContextManager.__enter__    s     '11$77r   c                P    R V n         WV3V n        \        P                  ! WW#4      # r   )r   r   r   __exit__r   typevalue	tracebacks   &&&&r   r#   MockContextManager.__exit__$   s0    y1'0016C 	Cr   r   r   r   )
__name__
__module____qualname____firstlineno__r   r   r#   __static_attributes____classdictcell____classcell__)r   __classdict__s   @@r   r   r      s     8C Cr   r   c                    a  V 3R  lpV# )c                     < \        SW4      # r   )r   )r   kwdsfuncs   *,r   helper#mock_contextmanager.<locals>.helper,   s    !$33r   r   )r5   r6   s   f r   mock_contextmanagerr8   +   s    4Mr   c                   &   a  ] tR t^1t o R tRtV tR# )MockResourcec                "    R V n         R V n        R# r   )yieldedstoppedr    s   &r   r   MockResource.__init__2   s    r   )r=   r<   Nr*   r+   r,   r-   r   r.   r/   r1   s   @r   r:   r:   1   s      r   r:   c               #   `   "   \        4       p  R V n        V x  R V n        R#   R T n        i ; i5iTN)r:   r<   r=   )mocks    r   mock_contextmanager_generatorrD   7   s+     >D
ts   ." 	.	+.c                   2   a  ] tR t^At o R tR tR tRtV tR# )Nestedc                     Wn         R V n        R # r   )managersenteredr   rH   s   &*r   r   Nested.__init__C   s     r   c                Z   V P                   e   \        R4      h\        4       V n         . p V P                   F=  pVP	                  VP                  4       4       V P                   P                  V4       K?  	  V#    T P                  ! \        P                  ! 4       !  '       g   h  T# ; i)NzContext is not reentrant)
rI   RuntimeErrorr   rH   appendr   
appendleftr#   sysexc_info)r   varsmgrs   &  r   r   Nested.__enter__G   s    <<#9::w	}}CMMO,'', % 	==#,,.11 2s   AA; ;,B*c                    TpV P                    F  p VP                  ! V!  '       d   RpK  K   	  R V n         W!Jd   VhR #   \         d#   p\        T4      YDP                  3p R p?KZ  R p?ii ; iN)NNN)rI   r#   BaseExceptionr%   __traceback__)r   rQ   exrS   es   &*   r   r#   Nested.__exit__U   sr     <<C3<<$$+B %   H  ! 31gq//23s   AA.A))A.)rI   rH   N	r*   r+   r,   r-   r   r   r#   r.   r/   r@   s   @r   rF   rF   A   s      r   rF   c                   2   a  ] tR t^et o R tR tR tRtV tR# )
MockNestedc                `    \         P                  ! V .VO5!   R V n        R V n        RV n        R# r   )rF   r   r   r   r   rJ   s   &*r   r   MockNested.__init__f   s*    (x(! r   c                :    R V n         \        P                  V 4      # r   )r   rF   r   r    s   &r   r   MockNested.__enter__l   s     %%r   c                L    R V n         Wn        \        P                  ! V .VO5!  # r   )r   r   rF   r#   r   rQ   s   &*r   r#   MockNested.__exit__p   s#    !t/h//r   r)   Nr\   r@   s   @r   r^   r^   e   s     &0 0r   r^   c                   n   a  ] tR t^vt o R tR tR tR tR tR t	R t
R tR	 tR
 tR tR tR tRtV tR# )FailureTestCasec                8    R  pV P                  \        V4       R# )c                  \    \         ;_uu_ 4        R R R 4       R #   + '       g   i     R # ; ir   foor   r   r   fooNotDeclared5FailureTestCase.testNameError.<locals>.fooNotDeclaredx   s    s   +	N)assertRaises	NameError)r   rl   s   & r   testNameErrorFailureTestCase.testNameErrorw   s    	)^4r   c                     ! R  R4      pV P                  \        \        P                  ! R4      4      ;_uu_ 4        \	        V! 4       4       RRR4       R#   + '       g   i     R# ; i)c                   &   a  ] tR t^}t o R tRtV tR# );FailureTestCase.testEnterAttributeError.<locals>.LacksEnterc                    R # r   r   r$   s   &&&&r   r#   DFailureTestCase.testEnterAttributeError.<locals>.LacksEnter.__exit__~       r   r   N)r*   r+   r,   r-   r#   r.   r/   r@   s   @r   
LacksEnterrt   }   s     ;;r   rx   zNobject does not support the context manager protocol (missed __enter__ method)NassertRaisesRegex	TypeErrorreescaper   )r   rx   s   & r   testEnterAttributeError'FailureTestCase.testEnterAttributeError|   sT    	< 	< ##Iryy(0   JL!	      AA)	c                v    ! R  R4      p\         P                  ! R4      pV P                  \        V4      ;_uu_ 4        \	        \        4       4       RRR4       V P                  \        V4      ;_uu_ 4        \	        V! 4       4       RRR4       R#   + '       g   i     LI; i  + '       g   i     R# ; i)c                   &   a  ] tR t^t o R tRtV tR# )9FailureTestCase.testExitAttributeError.<locals>.LacksExitc                    R # r   r   r    s   &r   r   CFailureTestCase.testExitAttributeError.<locals>.LacksExit.__enter__       r   r   N)r*   r+   r,   r-   r   r.   r/   r@   s   @r   	LacksExitr      s     $$r   r   zMobject does not support the context manager protocol (missed __exit__ method)N)r|   r}   rz   r{   r   object)r   r   msgs   &  r   testExitAttributeError&FailureTestCase.testExitAttributeError   s}    	% 	% ii'
 ##Is33FH 4##Is33IK  43 43333s   B9B'B$	'B8	c                     ! R  R4      pV P                  \        \        P                  ! R4      4      ;_uu_ 4        \	        V! 4       4       RRR4       R#   + '       g   i     R# ; i)c                   ,   a  ] tR t^t o R tR tRtV tR# )=FailureTestCase.testWithForAsyncManager.<locals>.AsyncManagerc                   "   R # 5ir   r   r    s   &r   
__aenter__HFailureTestCase.testWithForAsyncManager.<locals>.AsyncManager.__aenter__           c                   "   R # 5ir   r   r$   s   &&&&r   	__aexit__GFailureTestCase.testWithForAsyncManager.<locals>.AsyncManager.__aexit__        sr   r   N)r*   r+   r,   r-   r   r   r.   r/   r@   s   @r   AsyncManagerr      s     +BBr   r   zobject does not support the context manager protocol (missed __exit__ method) but it supports the asynchronous context manager protocol. Did you mean to use 'async with'?Nry   )r   r   s   & r   testWithForAsyncManager'FailureTestCase.testWithForAsyncManager   sW    	C 	C ##IryyJ0  
 LN#   r   c                     ! R  R4      pV P                  \        \        P                  ! R4      4      ;_uu_ 4        \	        V! 4       4      P                  R4       RRR4       R#   + '       g   i     R# ; i)c                   &   a  ] tR t^t o R tRtV tR# )EFailureTestCase.testAsyncEnterAttributeError.<locals>.LacksAsyncEnterc                   "   R # 5ir   r   r$   s   &&&&r   r   OFailureTestCase.testAsyncEnterAttributeError.<locals>.LacksAsyncEnter.__aexit__   r   r   r   N)r*   r+   r,   r-   r   r.   r/   r@   s   @r   LacksAsyncEnterr      s     BBr   r   z\object does not support the asynchronous context manager protocol (missed __aenter__ method)Nrz   r{   r|   r}   r   send)r   r   s   & r   testAsyncEnterAttributeError,FailureTestCase.testAsyncEnterAttributeError   sb    	C 	C ##Iryy)0   /+,11$7	       A''A8	c                    ! R  R4      p\         P                  ! R4      pV P                  \        V4      ;_uu_ 4        \	        \        4       4      P                  R4       RRR4       V P                  \        V4      ;_uu_ 4        \	        V! 4       4      P                  R4       RRR4       R#   + '       g   i     LX; i  + '       g   i     R# ; i)c                   &   a  ] tR t^t o R tRtV tR# )CFailureTestCase.testAsyncExitAttributeError.<locals>.LacksAsyncExitc                   "   R # 5ir   r   r    s   &r   r   NFailureTestCase.testAsyncExitAttributeError.<locals>.LacksAsyncExit.__aenter__   r   r   r   N)r*   r+   r,   r-   r   r.   r/   r@   s   @r   LacksAsyncExitr      s     ++r   r   z[object does not support the asynchronous context manager protocol (missed __aexit__ method)N)r|   r}   rz   r{   r   r   r   )r   r   r   s   &  r   testAsyncExitAttributeError+FailureTestCase.testAsyncExitAttributeError   s    	, 	, ii(
 ##Is33&(#((. 4##Is33.*+006 43 43333s   #B2 C2C	C	c                     ! R  R4      pV P                  \        \        P                  ! R4      4      ;_uu_ 4        \	        V! 4       4      P                  R4       RRR4       R#   + '       g   i     R# ; i)c                   ,   a  ] tR t^t o R tR tRtV tR# )@FailureTestCase.testAsyncWithForSyncManager.<locals>.SyncManagerc                    R # r   r   r    s   &r   r   JFailureTestCase.testAsyncWithForSyncManager.<locals>.SyncManager.__enter__   r   r   c                    R # r   r   r$   s   &&&&r   r#   IFailureTestCase.testAsyncWithForSyncManager.<locals>.SyncManager.__exit__   rw   r   r   Nr*   r+   r,   r-   r   r#   r.   r/   r@   s   @r   SyncManagerr      s     $;;r   r   zobject does not support the asynchronous context manager protocol (missed __aexit__ method) but it supports the context manager protocol. Did you mean to use 'with'?Nr   )r   r   s   & r   testAsyncWithForSyncManager+FailureTestCase.testAsyncWithForSyncManager   s_    	< 	< ##Iryy40  
 +-(--d3   r   c                8    R  pV P                  \        W!4       R# )c                      \        V R R4       R# ) singleN)compile)ss   &r   shouldRaiseSyntaxErrorGFailureTestCase.assertRaisesSyntaxError.<locals>.shouldRaiseSyntaxError   s    Ar8$r   N)rn   SyntaxError)r   codestrr   s   && r   assertRaisesSyntaxError'FailureTestCase.assertRaisesSyntaxError   s    	%+'=Gr   c                J    V P                  R 4       V P                  R4       R# )zwith mock as None:
  passzwith mock as (None):
  passNr   r    s   &r   testAssignmentToNoneError)FailureTestCase.testAssignmentToNoneError   s$    $$%AB$$	r   c                J    V P                  R 4       V P                  R4       R# )zwith mock as None,:
  passzwith mock as (None,):
  passNr   r    s   &r   ,testAssignmentToTupleOnlyContainingNoneError<FailureTestCase.testAssignmentToTupleOnlyContainingNoneError   s$    $$%BC$$	r   c                (    V P                  R 4       R# )z%with mock as (foo, None, bar):
  passNr   r    s   &r   (testAssignmentToTupleContainingNoneError8FailureTestCase.testAssignmentToTupleContainingNoneError   s    $$	r   c                   a a  ! R  R\         4      oVV 3R lpS P                  \        V4       S P                  S P                  R4       R# )c                   ,   a  ] tR t^t o R tR tRtV tR# )4FailureTestCase.testEnterThrows.<locals>.EnterThrowsc                    \        R 4      h)zEnter threwrM   r    s   &r   r   >FailureTestCase.testEnterThrows.<locals>.EnterThrows.__enter__   s    "=11r   c                    R # r   r   r   r   s   &*r   r#   =FailureTestCase.testEnterThrows.<locals>.EnterThrows.__exit__       r   r   Nr   r@   s   @r   EnterThrowsr      s     2 r   r   c                  ~   < S! 4       p R Sn         V ;_uu_ 4       Sn          R R R 4       R #   + '       g   i     R # ; ir   rj   )ctr   r   s    r   shouldThrow4FailureTestCase.testEnterThrows.<locals>.shouldThrow   s+    BDH tx s   +<	N)r   rn   rM   assertEqualrk   )r   r   r   s   f @r   testEnterThrowsFailureTestCase.testEnterThrows   s:    	& 		 	,44(r   c                ^   a  ! R  R\         4      oV3R lpV P                  \        V4       R# )c                   ,   a  ] tR t^t o R tR tRtV tR# )2FailureTestCase.testExitThrows.<locals>.ExitThrowsc                    R # r   r   r    s   &r   r   <FailureTestCase.testExitThrows.<locals>.ExitThrows.__enter__   s    r   c                    \        ^*4      h)*   r   r   s   &*r   r#   ;FailureTestCase.testExitThrows.<locals>.ExitThrows.__exit__   s    "2&&r   r   Nr   r@   s   @r   
ExitThrowsr      s     ' 'r   r   c                  b   < S ! 4       ;_uu_ 4         R R R 4       R #   + '       g   i     R # ; ir   r   )r   s   r   r   3FailureTestCase.testExitThrows.<locals>.shouldThrow   s     s   .	N)r   rn   rM   )r   r   r   s   & @r   testExitThrowsFailureTestCase.testExitThrows   s&    	' 	'
	 	,4r   rj   N)r*   r+   r,   r-   rp   r~   r   r   r   r   r   r   r   r   r   r   r   r.   r/   r@   s   @r   rg   rg   v   sL     5
"!
$87
4H

)$	5 	5r   rg   c                   Z   a  ] tR t^t o R tR tR tR tR tR t	R t
RR	 ltR
 tRtV tR# )ContextmanagerAssertionMixinc                &    \        R 4      V n        R# )ztest exceptionN)rM   TEST_EXCEPTIONr    s   &r   setUp"ContextmanagerAssertionMixin.setUp   s    *+;<r   c                    V P                  VP                  4       V P                  VP                  4       V P	                  VP
                  R 4       R # r   )
assertTruer   assertFalser   r   r   r   mock_managers   &&r   assertInWithManagerInvariants:ContextmanagerAssertionMixin.assertInWithManagerInvariants   s>    112112//6r   c                    V P                  VP                  4       V P                  VP                  4       V P                  VP                  V4       R # r   )r   r   r   r   r   )r   r   r   s   &&&r    assertAfterWithManagerInvariants=ContextmanagerAssertionMixin.assertAfterWithManagerInvariants  s<    112001//;r   c                *    V P                  VR4       R # rV   )r   r   s   &&r   'assertAfterWithManagerInvariantsNoErrorDContextmanagerAssertionMixin.assertAfterWithManagerInvariantsNoError  s    --l	 r   c                r    V P                  VP                  4       V P                  VP                  4       R # r   )r   r<   r   r=   r   mock_generators   &&r   assertInWithGeneratorInvariants<ContextmanagerAssertionMixin.assertInWithGeneratorInvariants  s(    ..///0r   c                r    V P                  VP                  4       V P                  VP                  4       R # r   r   r<   r=   r  s   &&r   )assertAfterWithGeneratorInvariantsNoErrorFContextmanagerAssertionMixin.assertAfterWithGeneratorInvariantsNoError  &    ../../r   c                    V P                   hr   r   r    s   &r   raiseTestException/ContextmanagerAssertionMixin.raiseTestException  s    !!!r   Nc                   V P                  VP                  4       V P                  VP                  4       VfC   V P                  VP                  ^,          V P
                  4       \        V P
                  4      pV P                  VP                  ^ ,          V4       V P                  VP                  ^,          V4       V P                  VP                  ^,          R 4       R # r   )	r   r   r   r   r   r   r%   assertIsInstanceassertIsNot)r   r   exc_types   &&&r   )assertAfterWithManagerInvariantsWithErrorFContextmanagerAssertionMixin.assertAfterWithManagerInvariantsWithError  s    112001\33A68K8KLD//0H//2H=l44Q7B//2D9r   c                r    V P                  VP                  4       V P                  VP                  4       R # r   r  r  s   &&r   +assertAfterWithGeneratorInvariantsWithErrorHContextmanagerAssertionMixin.assertAfterWithGeneratorInvariantsWithError"  r
  r   r  r   )r*   r+   r,   r-   r   r   r   r   r  r  r  r  r  r.   r/   r@   s   @r   r   r      s7     =7
<
 10"
:0 0r   r   c                   J   a  ] tR tRt o R tR tR tR tR tR t	R t
R	tV tR
# )NonexceptionalTestCasei'  c                f    \        4       ;_uu_ 4         R R R 4       R #   + '       g   i     R # ; ir   rD   r    s   &r   testInlineGeneratorSyntax0NonexceptionalTestCase.testInlineGeneratorSyntax(  s    *,, -,,,s   0	c                    \        4       pV;_uu_ 4         R R R 4       V P                  V4       R #   + '       g   i     L#; ir   )rD   r   )r   rC   s   & r   testUnboundGenerator+NonexceptionalTestCase.testUnboundGenerator,  s-    ,.T 44T: Ts	   2A	c                    \        4       ;_uu_ 4       pV P                  V4       R R R 4       V P                  X4       R #   + '       g   i     L#; ir   rD   r  r  r   rk   s   & r   testInlineGeneratorBoundSyntax5NonexceptionalTestCase.testInlineGeneratorBoundSyntax2  s9    *,,005 - 	66s; -,   A  A	c                    \        4       ;_uu_ 4       pV P                  V4       R R R 4       V P                  X4       R #   + '       g   i     L#; ir   r"  r#  s   & r   *testInlineGeneratorBoundToExistingVariableANonexceptionalTestCase.testInlineGeneratorBoundToExistingVariable8  s7    *,,005 -66s; -,r&  c                    \        4       ;_uu_ 4       V n        V P                  V P                  4       R R R 4       V P                  V P                  4       R #   + '       g   i     L-; ir   )rD   rk   r  r  r    s   &r   (testInlineGeneratorBoundToDottedVariable?NonexceptionalTestCase.testInlineGeneratorBoundToDottedVariable=  sA    *,,00: -66txx@ -,s   !AA)	c                    \        4       pV;_uu_ 4       pV P                  V4       V P                  V4       R R R 4       V P                  X4       V P	                  V4       R #   + '       g   i     L4; ir   )rD   r  r   r  r   )r   rC   rk   s   &  r   testBoundGenerator)NonexceptionalTestCase.testBoundGeneratorB  sX    ,.TS005..t4  	66s;44T:	 Ts   #A$$A4	c           	        \        4       pT;_uu_ 4       p\        4       pV;_uu_ 4       pV P                  V4       V P                  V4       V P                  V4       V P                  V4       R R R 4       V P                  V4       V P	                  X4       V P                  V4       V P                  V4       R R R 4       V P                  V4       V P	                  X4       R #   + '       g   i     L; i  + '       g   i     LG; ir   )rD   r   r  r   r  )r   mock_ark   mock_bbars   &    r   testNestedSingleStatements1NonexceptionalTestCase.testNestedSingleStatementsJ  s    .0Vs24F3226:226:44S944S9	 
 88@::3?..v6005  	44V<66s;  Vs$   C:AC'	/AC:'C72C::D
	rj   N)r*   r+   r,   r-   r  r  r$  r(  r+  r.  r4  r.   r/   r@   s   @r   r  r  '  s.     ;<<
A
;< <r   r  c                   J   a  ] tR tRt o R tR tR tR tR tR t	R t
R	tV tR
# )NestedNonexceptionalTestCasei[  c                x    \        \        4       4      ;_uu_ 4         R R R 4       R #   + '       g   i     R # ; ir   rF   rD   r    s   &r   "testSingleArgInlineGeneratorSyntax?NestedNonexceptionalTestCase.testSingleArgInlineGeneratorSyntax]  s#    1344 5444s   (9	c                    \        4       p\        V4      ;_uu_ 4       pV P                  V4       R R R 4       V P                  V4       R #   + '       g   i     L#; ir   rD   rF   r   r   r   mrk   s   &  r   testSingleArgBoundToNonTuple9NestedNonexceptionalTestCase.testSingleArgBoundToNonTuplea  s@    )+ AYY#..q1 44Q7 Y   AA	c                    \        4       p\        V4      ;_uu_ 4       pV P                  V4       R R R 4       V P                  V4       R #   + '       g   i     L#; ir   r=  r>  s   &  r   2testSingleArgBoundToSingleElementParenthesizedListONestedNonexceptionalTestCase.testSingleArgBoundToSingleElementParenthesizedListi  s@    )+ AYY3..q1 44Q7 YrB  c                8    R  pV P                  \        V4       R# )c                  |    \        \        4       4      ;_uu_ 4       w  r R R R 4       R #   + '       g   i     R # ; ir   r9  )rk   r3  s     r   shouldThrowValueErroriNestedNonexceptionalTestCase.testSingleArgBoundToMultipleElementTupleError.<locals>.shouldThrowValueErrorr  s'    5788JS 9888s   *;	N)rn   
ValueError)r   rH  s   & r   -testSingleArgBoundToMultipleElementTupleErrorJNestedNonexceptionalTestCase.testSingleArgBoundToMultipleElementTupleErrorq  s    	 	*&;<r   c                   \        4       p\        V4      pV;_uu_ 4        V P                  V4       V P                  V4       R R R 4       V P                  V4       V P                  V4       R #   + '       g   i     L4; ir   rD   r^   r   r   )r   r8   mock_nesteds   &  r   testSingleArgUnbound1NestedNonexceptionalTestCase.testSingleArgUnboundw  sd    ;= !45[../BC..{;  	445HI44[A	 [s   #A//A?	c                   \        4       p\        4       p\        4       p\        WV4      pV;_uu_ 4        V P                  V4       V P                  V4       V P                  V4       V P                  V4       R R R 4       V P                  V4       V P                  V4       V P                  V4       V P                  V4       R #   + '       g   i     LV; ir   rN  )r   r?  norO  s   &    r   testMultipleArgUnbound3NestedNonexceptionalTestCase.testMultipleArgUnbound  s    )+)+)+ q)[..q1..q1..q1..{;	 
 	44Q744Q744Q744[A [s   ACC	c                   \        \        4       \        4       \        4       4      pV;_uu_ 4       w  r#pV P                  V4       V P                  V4       V P                  V4       V P                  V4       R R R 4       V P	                  X4       V P	                  X4       V P	                  X4       V P                  V4       R #   + '       g   i     LV; ir   )r^   rD   r  r   r  r   )r   rO  r?  rS  rT  s   &    r   testMultipleArgBound1NestedNonexceptionalTestCase.testMultipleArgBound  s     !>!@)+-J-LN[IQ1003003003..{;	 
 	66q966q966q944[A [s   ACC	r   N)r*   r+   r,   r-   r:  r@  rD  rK  rP  rU  rX  r.   r/   r@   s   @r   r7  r7  [  s1     88=BBB Br   r7  c                   h   a  ] tR tRt o R tR tR tR tR tR t	R t
R	 tR
 tR tR tR tRtV tR# )ExceptionalTestCasei  c                   a a \        4       oVV 3R  lpS P                  \        V4       S P                  S4       S P	                  S P
                  4       R# )c                     < S ;_uu_ 4       Sn         SP                  S 4       SP                  SP                   4       SP                  4        R R R 4       R #   + '       g   i     R # ; ir   )resourcer   r  r  cmr   s   r   r   ;ExceptionalTestCase.testSingleResource.<locals>.shouldThrow  sD    t}222644T]]C'') s   AAA)	N)rD   rn   rM   r  r  r^  r   r   r`  s   f @r   testSingleResource&ExceptionalTestCase.testSingleResource  sB    *,	*
 	,466r:88Gr   c                   a a \        4       oVV 3R  lpS P                  \        V4       S P                  S\        4       R# )c                  r   < S ;_uu_ 4       Sn         ^^ ,           RRR4       R#   + '       g   i     R# ; i   N)r^  r_  s   r   r   @ExceptionalTestCase.testExceptionNormalized.<locals>.shouldThrow  s!    t} Q s   %6	N)rD   rn   ZeroDivisionErrorr  rb  s   f @r   testExceptionNormalized+ExceptionalTestCase.testExceptionNormalized  s4    *,	
 	+[966r;LMr   c                   a aa \        4       o\        4       oVVV 3R  lpS P                  \        V4       S P                  S4       S P                  S4       S P	                  S P
                  4       S P	                  S P                  4       R# )c            	        < S ;_uu_ 4       Sn         S;_uu_ 4       Sn        SP                  S 4       SP                  S4       SP                  SP                   4       SP                  SP                  4       SP	                  4        R R R 4       R R R 4       R #   + '       g   i     L; i  + '       g   i     R # ; ir   rk   r3  r   r  r  r1  r2  r   s   r   r   CExceptionalTestCase.testNestedSingleStatements.<locals>.shouldThrow  s}    48Vtx66v>66v>88B88B++-  V s#   B/A.B	
B/B,'B//C 	N)rD   rn   rM   r  r  rk   r3  r   r   r1  r2  s   f @@r   r4  .ExceptionalTestCase.testNestedSingleStatements  sj    .0.0	. 	,466v>66v>88B88Br   c                ^  a aaa \        4       o\        4       o\        SS4      oVVVV 3R  lpS P                  \        V4       S P	                  S4       S P	                  S4       S P	                  S4       S P                  S P                  4       S P                  S P                  4       R# )c                  b  < S;_uu_ 4       w  Sn         Sn        SP                  S 4       SP                  S4       SP                  S4       SP                  SP                   4       SP                  SP                  4       SP	                  4        R R R 4       R #   + '       g   i     R # ; ir   )
resource_a
resource_br   r  r  )cm_acm_brO  r   s   r   r   OExceptionalTestCase.testMultipleResourcesInSingleStatement.<locals>.shouldThrow  sy     B$/2248224822;?44T__E44T__E'') s   BBB.	N)rD   r^   rn   rM   r  r  rv  rw  )r   r   rx  ry  rO  s   f @@@r   &testMultipleResourcesInSingleStatement:ExceptionalTestCase.testMultipleResourcesInSingleStatement  s    ,.,. t,	* 	* 	,466t<66t<66{C88I88Ir   c                  a aa \        4       o\        4       oR S n        VVV 3R lpS P                  \        V4       S P	                  S4       S P                  S P                  4       S P                  S P                  R 4       S P                  SP                  4       S P                  SP                  4       S P                  SP                  R 4       R # )Nc            	      0  < S ;_uu_ 4       Sn         SP                  S 4       SP                  SP                   4       SP                  4        S;_uu_ 4       Sn         R R R 4       R R R 4       R #   + '       g   i     L; i  + '       g   i     R # ; ir   )rk   r   r  r  r3  rp  s   r   r   PExceptionalTestCase.testNestedExceptionBeforeInnerStatement.<locals>.shouldThrow  sb    48226:44TXX>'')Vtx 	  V	 s$   ABA1	B1B<BB	)rD   r3  rn   rM   r  r  rk   r   r   r   r   r   rr  s   f @@r   'testNestedExceptionBeforeInnerStatement;ExceptionalTestCase.testNestedExceptionBeforeInnerStatement  s    .0.0	 	,466v>88B 	4(,,-++,))40r   c                   a aa \        4       o\        4       oVVV 3R  lpS P                  \        V4       S P                  S4       S P	                  S4       S P                  S P                  4       S P                  S P                  4       R# )c            	        < S ;_uu_ 4       Sn         S;_uu_ 4       Sn        SP                  S 4       SP                  S4       SP                  SP                   4       SP                  SP                  4       R R R 4       SP	                  4        R R R 4       R #   + '       g   i     L*; i  + '       g   i     R # ; ir   ro  rp  s   r   r   OExceptionalTestCase.testNestedExceptionAfterInnerStatement.<locals>.shouldThrow  s    48Vtx66v>66v>88B88B	 
 '') V s#   B/AB	:B/B,'B//C 	N)	rD   rn   rM   r  r   r  rk   r  r3  rr  s   f @@r   &testNestedExceptionAfterInnerStatement:ExceptionalTestCase.testNestedExceptionAfterInnerStatement  sj    .0.0	* 	,466v>44V<88B66txx@r   c                   a \         R  4       oV3R lpV P                  \        R4      ;_uu_ 4        V! 4        RRR4       R#   + '       g   i     R# ; i)c               3      "   R x  R # 5ir   r   r   r   r   r`  8ExceptionalTestCase.testRaisedStopIteration1.<locals>.cm          	c                  b   < S ! 4       ;_uu_ 4        \        R 4      h  + '       g   i     R# ; i	from withNStopIterationr`  s   r   r   AExceptionalTestCase.testRaisedStopIteration1.<locals>.shouldThrow      #K00    .	r  N)r   rz   r  rb  s   & @r   testRaisedStopIteration1,ExceptionalTestCase.testRaisedStopIteration1  sD    		 
		1 ##M;??M @???s   AA	c                   a  ! R  R\         4      oV3R lpV P                  \        R4      ;_uu_ 4        V! 4        RRR4       R#   + '       g   i     R# ; i)c                   ,   a  ] tR tRt o R tR tRtV tR# )8ExceptionalTestCase.testRaisedStopIteration2.<locals>.cmi  c                    R # r   r   r    s   &r   r   BExceptionalTestCase.testRaisedStopIteration2.<locals>.cm.__enter__  r   r   c                    R # r   r   r$   s   &&&&r   r#   AExceptionalTestCase.testRaisedStopIteration2.<locals>.cm.__exit__  r   r   r   Nr   r@   s   @r   r`  r          r   r`  c                  b   < S ! 4       ;_uu_ 4        \        R 4      h  + '       g   i     R# ; ir  r  r  s   r   r   AExceptionalTestCase.testRaisedStopIteration2.<locals>.shouldThrow  r  r  r  N)r   rz   r  rb  s   & @r   testRaisedStopIteration2,ExceptionalTestCase.testRaisedStopIteration2
  s>    	 		1 ##M;??M @???s   AA	c                   a \         R  4       oV3R lpV P                  \        4      ;_uu_ 4        V! 4        RRR4       R#   + '       g   i     R# ; i)c               3      "   R x  R # 5ir   r   r   r   r   r`  8ExceptionalTestCase.testRaisedStopIteration3.<locals>.cm  r  r  c                  t   < S ! 4       ;_uu_ 4        \        \        . 4      4      h  + '       g   i     R # ; ir   )nextiterr  s   r   r   AExceptionalTestCase.testRaisedStopIteration3.<locals>.shouldThrow   s"    48n$ s   &7	N)r   rn   r  rb  s   & @r   testRaisedStopIteration3,ExceptionalTestCase.testRaisedStopIteration3  sC     
	 
		% }--M .---s   AA	c                X   a \         R  4       oV3R lpV P                  \        V4       R# )c               3      "   R x  R # 5ir   r   r   r   r   r`  8ExceptionalTestCase.testRaisedGeneratorExit1.<locals>.cm)  r  r  c                  b   < S ! 4       ;_uu_ 4        \        R 4      h  + '       g   i     R# ; ir  GeneratorExitr  s   r   r   AExceptionalTestCase.testRaisedGeneratorExit1.<locals>.shouldThrow-  r  r  N)r   rn   r  rb  s   & @r   testRaisedGeneratorExit1,ExceptionalTestCase.testRaisedGeneratorExit1'  s,    		 
		1 	-5r   c                ^   a  ! R  R\         4      oV3R lpV P                  \        V4       R# )c                   ,   a  ] tR tRt o R tR tRtV tR# )8ExceptionalTestCase.testRaisedGeneratorExit2.<locals>.cmi5  c                    R # r   r   r    s   &r   r   BExceptionalTestCase.testRaisedGeneratorExit2.<locals>.cm.__enter__6  r   r   c                    R # r   r   r$   s   &&&&r   r#   AExceptionalTestCase.testRaisedGeneratorExit2.<locals>.cm.__exit__8  r   r   r   Nr   r@   s   @r   r`  r  5  r  r   r`  c                  b   < S ! 4       ;_uu_ 4        \        R 4      h  + '       g   i     R# ; ir  r  r  s   r   r   AExceptionalTestCase.testRaisedGeneratorExit2.<locals>.shouldThrow;  r  r  N)r   rn   r  rb  s   & @r   testRaisedGeneratorExit2,ExceptionalTestCase.testRaisedGeneratorExit23  s&    	& 		1 	-5r   c                   a a  ! R  R\         4      oVV 3R lpV! 4        VV 3R lpS P                  \        V4       VV 3R lpS P                  \        V4       R# )c                   2   a  ] tR tRt o R tR tR tRtV tR# )0ExceptionalTestCase.testErrorsInBool.<locals>.cmiE  c                :   a  ! V3R  lR4      pV! 4       V n         R# )c                   .   <a  ] tR tRt o V3R ltRtV tR# )GExceptionalTestCase.testErrorsInBool.<locals>.cm.__init__.<locals>.BooliG  c                   < S! 4       # r   r   )r   bool_conversions   &r   __bool__PExceptionalTestCase.testErrorsInBool.<locals>.cm.__init__.<locals>.Bool.__bool__H  s    .00r   r   N)r*   r+   r,   r-   r  r.   r/   )r1   r  s   @r   Boolr  G  s     1 1r   r  Nexit_result)r   r  r  s   &f r   r   9ExceptionalTestCase.testErrorsInBool.<locals>.cm.__init__F  s    1 1 $(6 r   c                    ^# )   r   r    s   &r   r   :ExceptionalTestCase.testErrorsInBool.<locals>.cm.__enter__K  s    r   c                    V P                   # r   r  r   abcs   &&&&r   r#   9ExceptionalTestCase.testErrorsInBool.<locals>.cm.__exit__M  s    '''r   r  Nr\   r@   s   @r   r`  r  E  s     *
( (r   r`  c                     < S ! R  4      ;_uu_ 4        SP                  R4       RRR4       R#   + '       g   i     R# ; i)c                      R # r   r   r   r   r   <lambda>JExceptionalTestCase.testErrorsInBool.<locals>.trueAsBool.<locals>.<lambda>Q  s    Dr   Should NOT see thisNfailr_  s   r   
trueAsBool8ExceptionalTestCase.testErrorsInBool.<locals>.trueAsBoolP  *    L!!		/0 "!!!	   /A 	c                     < S ! R  4      ;_uu_ 4        SP                  R4       RRR4       R#   + '       g   i     R# ; i)c                      R # Fr   r   r   r   r  KExceptionalTestCase.testErrorsInBool.<locals>.falseAsBool.<locals>.<lambda>V  s    Er   zShould raiseNr  r_  s   r   falseAsBool9ExceptionalTestCase.testErrorsInBool.<locals>.falseAsBoolU  s)    M""		.) #"""r  c                     < S ! R  4      ;_uu_ 4        SP                  R4       RRR4       R#   + '       g   i     R# ; i)c                      ^^ ,          # )rh  r   r   r   r   r  JExceptionalTestCase.testErrorsInBool.<locals>.failAsBool.<locals>.<lambda>[  s    AqDr   r  Nr  r_  s   r   
failAsBool8ExceptionalTestCase.testErrorsInBool.<locals>.failAsBoolZ  r  r  N)r   rn   AssertionErrorrj  )r   r  r  r  r`  s   f   @r   testErrorsInBool$ExceptionalTestCase.testErrorsInBoolA  sJ    		( 		(	1 		* 	.+6	1 	+Z8r   )r3  rk   r^  rv  rw  N)r*   r+   r,   r-   rc  rk  r4  r{  r  r  r  r  r  r  r  r  r.   r/   r@   s   @r   r[  r[    sK     	HNC"J&1*A"
669 9r   r[  c                   >   a  ] tR tRt o R tR tR tR tR tRt	V t
R# )	NonLocalFlowControlTestCasei`  c                    ^ p V^,          p\        4       ;_uu_ 4        V^
,          p RRR4       T P                  T^4       R#   + '       g   i     M; iT^d,          pKa      NrD   r   r   counters   & r   testWithBreak)NonLocalFlowControlTestCase.testWithBreakb  sS    qLG.002 1 	"%	 10 sNGs   AA	c                    ^ p V^,          pV^8  d   M'\        4       ;_uu_ 4        V^
,          p RRR4       K9  V P                  V^4       R#   + '       g   i     M; iT^d,          pKk  r  r  r  s   & r   testWithContinue,NonLocalFlowControlTestCase.testWithContinuel  s`    qLG{.002 10 	"%	 10 sNGs   AA 	c                :    R  pV P                  V! 4       ^4       R# )c                      ^ p  V ^,          p \        4       ;_uu_ 4        V ^
,          p V uuRRR4       #   + '       g   i     M; iT ^d,          p KP  r  r  )r  s    r   rk   7NonLocalFlowControlTestCase.testWithReturn.<locals>.fooy  sB    G1244rMG" 5444 3s	   5A	N)r   r#  s   & r   testWithReturn*NonLocalFlowControlTestCase.testWithReturnx  s    	 	#r   c                T    R  p\        V! 4       4      pV P                  V^^.4       R# )c               3   |   "   \        4       ;_uu_ 4        ^x  ^x  RRR4       R#   + '       g   i     R# ; i5i)   Nr  r   r   r   gen6NonLocalFlowControlTestCase.testWithYield.<locals>.gen  s&     .00 1000s   <	(
<9		<N)listr   )r   r  xs   &  r   testWithYield)NonLocalFlowControlTestCase.testWithYield  s(    	 KRH%r   c                   ^ p V^,          p\        4       ;_uu_ 4        V^
,          p\        h  + '       g   i     M; iT^d,          pT P                  R4       R#   \         d    T P                  T^4        R# i ; i)r  NzDidn't raise RuntimeError)rD   rM   r  r   r  s   & r   testWithRaise)NonLocalFlowControlTestCase.testWithRaise  sq    		3qLG.002"" 10 sNG II12  	*Wb)	*s   A /?	A A?>A?r   N)r*   r+   r,   r-   r  r  r   r	  r  r.   r/   r@   s   @r   r  r  `  s#     &
&	$&3 3r   r  c                   2   a  ] tR tRt o R tR tR tRtV tR# )AssignmentTargetTestCasei  c                   ^. RO/p\        4       ;_uu_ 4       V^,          ^ &   V P                  \        VP                  4       4      ^.4       V P                  V^,          ^ ,          P                  \
        4       RRR4       \        4       ;_uu_ 4       \        VP                  4       4      ^ ,          ^&   V P                  \        VP                  4       4      ^.4       V P                  V^,          ^,          P                  \
        4       RRR4       \        4       ;_uu_ 4       V^&   \        VP                  4       4      pVP                  4        V P                  V^^.4       RRR4        ! R R4      pV! 4       p\        4       ;_uu_ 4       Vn        V P                  VR4       RRR4       R#   + '       g   i     ELE; i  + '       g   i     L; i  + '       g   i     L|; i  + '       g   i     R# ; i)rh  Nc                       ] tR tRtRtR# );AssignmentTargetTestCase.testSingleComplexTarget.<locals>.Ci  r   Nr*   r+   r,   r-   r.   r   r   r   Cr        r   r  rk   r  rh     )
rD   r   r  keysr   r:   valuessortrk   assertHasAttr)r   targetsr  r  blahs   &    r   testSingleComplexTarget0AssignmentTargetTestCase.testSingleComplexTarget  sa   i.*,,
1T',,.1A37WQZ]44lC - +,,W^^5E0Fq0I!0LT',,.1A37WQZ]44lC - +,,
'DIIKTAq6* - 	s*,,tU+ -, -,, -, -, -,,s2   A#F8A:G*AGG28G		G	G/	2H	c                &    ! R  R4      p^. RO/pV! 4       ;_uu_ 4       w  V^,          ^ &   V^,          ^&   V^,          ^&   V P                  V^. RO/4       RRR4       V! 4       ;_uu_ 4       w  \        VP                  4       4      ^ ,          ^&   \        VP                  4       4      ^ ,          ^&   \        VP                  4       4      ^ ,          ^ &   V P                  V^. RO/4       RRR4       V! 4       ;_uu_ 4       w  V^&   V^&   V^&   V P                  V^^^^^^/4       RRR4        ! R R4      pV! 4       pV! 4       ;_uu_ 4       w  Vn        Vn        Vn        V P                  VP                  ^4       V P                  VP                  ^4       V P                  VP
                  ^4       RRR4       R#   + '       g   i     ELu; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     R# ; i)c                   ,   a  ] tR tRt o R tR tRtV tR# )>AssignmentTargetTestCase.testMultipleComplexTargets.<locals>.Ci  c                    R# )rh  rh  r  r  r   r    s   &r   r   HAssignmentTargetTestCase.testMultipleComplexTargets.<locals>.C.__enter__  s    r   c                    R # r   r   r   tvtbs   &&&&r   r#   GAssignmentTargetTestCase.testMultipleComplexTargets.<locals>.C.__exit__  s    $r   r   Nr   r@   s   @r   r  r"    s     /..r   r  Nc                       ] tR tRtRtR# )>AssignmentTargetTestCase.testMultipleComplexTargets.<locals>.Bi  r   Nr  r   r   r   Br-    r  r   r.  r  r$  )r  r  rh  )r   r  r  onetwothree)r   r  r  r.  r  s   &    r   testMultipleComplexTargets3AssignmentTargetTestCase.testMultipleComplexTargets  s   	/ 	/ i.SSAWQZ]GAJqM71:a=Wq)n5 SSnT'..*+A.q148H3I!3LQ3OQUV]VdVdVfQghiQjklQmWq)n5 SS8WQZWQZWq!Q1a&89 sSS4TXtxTXXq)TXXq)TZZ+ S SSSS SSs1   9G0A>G&G,A(G?G	G)	,G<	?H	c                    \        \        ^^4      4      ;_uu_ 4       EvrpV P                  V^4       V P                  V^^.4       V P                  V^4       RRR4       R#   + '       g   i     R# ; irg  )r   ranger   r  s   &   r   testWithExtendedTargets0AssignmentTargetTestCase.testWithExtendedTargets  s\    q!%%!Q"QA'Q" &%%%s   <A$$A5	r   N)	r*   r+   r,   r-   r  r2  r6  r.   r/   r@   s   @r   r  r    s     ,",$# #r   r  c                   ,   a  ] tR tRt o R tR tRtV tR# )ExitSwallowsExceptionTestCasei  c                     ! R  R4      p V! 4       ;_uu_ 4        ^^ ,           RRR4       R#   + '       g   i     R# ; i  \          d    T P                  R4        R# i ; i)c                   ,   a  ] tR tRt o R tR tRtV tR# )SExitSwallowsExceptionTestCase.testExitTrueSwallowsException.<locals>.AfricanSwallowi  c                    R # r   r   r    s   &r   r   ]ExitSwallowsExceptionTestCase.testExitTrueSwallowsException.<locals>.AfricanSwallow.__enter__      r   c                    R # r   r   r'  s   &&&&r   r#   \ExitSwallowsExceptionTestCase.testExitTrueSwallowsException.<locals>.AfricanSwallow.__exit__  s    r   r   Nr   r@   s   @r   AfricanSwallowr<    s     %55r   rB  Nz,ZeroDivisionError should have been swallowed)rj  r  )r   rB  s   & r   testExitTrueSwallowsException;ExitSwallowsExceptionTestCase.testExitTrueSwallowsException  sN    	6 	6	F!!! "!!!  	FIIDE	Fs*   A 
/A A 	A  A A#"A#c                     ! R  R4      p V! 4       ;_uu_ 4        ^^ ,           RRR4       V P                  R4       R#   + '       g   i     L#; i  \         d     R# i ; i)c                   ,   a  ] tR tRt o R tR tRtV tR# )ZExitSwallowsExceptionTestCase.testExitFalseDoesntSwallowException.<locals>.EuropeanSwallowi  c                    R # r   r   r    s   &r   r   dExitSwallowsExceptionTestCase.testExitFalseDoesntSwallowException.<locals>.EuropeanSwallow.__enter__  r?  r   c                    R # r  r   r'  s   &&&&r   r#   cExitSwallowsExceptionTestCase.testExitFalseDoesntSwallowException.<locals>.EuropeanSwallow.__exit__  s    r   r   Nr   r@   s   @r   EuropeanSwallowrG    s     %66r   rL  Nz)ZeroDivisionError should have been raised)r  rj  )r   rL  s   & r   #testExitFalseDoesntSwallowExceptionAExitSwallowsExceptionTestCase.testExitFalseDoesntSwallowException  sP    	7 	7	C ""! #
 IIAB #"  		s'   A 
A A  A	A A"!A"r   N)r*   r+   r,   r-   rC  rM  r.   r/   r@   s   @r   r9  r9    s     F
C 
Cr   r9  c                      a  ] tR tRt o  ! R R]4      t ! R R]4      t ! R R]4      t ! R R	]4      tR
 t	R t
R tR tR tR tRtV tR# )
NestedWithi  c                   6   a  ] tR tRt o RR ltR tR tRtV tR# )NestedWith.Dummyi  Nc                F    Vf   T pWn         W n        RV n        RV n        R # NF)r&   gobbler   r   )r   r&   rU  s   &&&r   r   NestedWith.Dummy.__init__  s&    }J K %D$Dr   c                (    R V n         V P                  # r   )r   r&   r    s   &r   r   NestedWith.Dummy.__enter__  s     $D::r   c                H    R V n         Wn        V P                  '       d   R # R# rB   )r   rQ   rU  rd   s   &*r   r#   NestedWith.Dummy.__exit__  s     #D$M{{{ r   )r   rQ   r   rU  r&   rT  r\   r@   s   @r   DummyrR    s     	%		 	r   r[  c                   &   a  ] tR tRt o R tRtV tR# )NestedWith.InitRaisesi  c                    \        4       hr   r   r    s   &r   r   NestedWith.InitRaises.__init__  s	    ,.0r   r   Nr?   r@   s   @r   
InitRaisesr]    s     00r   r`  c                   ,   a  ] tR tRt o R tR tRtV tR# )NestedWith.EnterRaisesi  c                    \        4       hr   r   r    s   &r   r    NestedWith.EnterRaises.__enter__  s	    <>1r   c                    R # r   r   rd   s   &*r   r#   NestedWith.EnterRaises.__exit__  s    tr   r   Nr   r@   s   @r   EnterRaisesrb    s     1++r   rg  c                   ,   a  ] tR tRt o R tR tRtV tR# )NestedWith.ExitRaisesi  c                    R # r   r   r    s   &r   r   NestedWith.ExitRaises.__enter__  s    Tr   c                    \        4       hr   r   rd   s   &*r   r#   NestedWith.ExitRaises.__exit__  s	    \^';r   r   Nr   r@   s   @r   
ExitRaisesri    s     !;;r   rn  c           	        V P                  4       ;_uu_ 4       qP                  4       ;_uu_ 4       pV P                  VP                  4       V P                  VP                  4       R R R 4       R R R 4       V P                  XP                  4       V P                  XP                  4       R #   + '       g   i     LP; i  + '       g   i     L[; ir   )r[  r   r   r   )r   r  r  s   &  r   testNoExceptionsNestedWith.testNoExceptions  so    ZZ\\Q

OOANN+OOANN+ !-\ 	&&	 !-\\s"   C7B0	(C0C ;CC	c           	     f    V P                  4       ;_uu_ 4       qP                  4       ;_uu_ 4         R R R 4       R R R 4       T P                  XP                  4       T P                  TP
                  4       R #   + '       g   i     LP; i  + '       g   i     L[; i  \         d     Lki ; ir   )r[  r`  rM   r   r   r   r   r  s   & r   testExceptionInExprList"NestedWith.testExceptionInExprList  si    	OO$5$5 %6 	'& %6$5 		sC   B" BA<	BB" <BBB	B" B" "B0/B0c           	         V P                  4       ;_uu_ 4       qP                  4       ;_uu_ 4        V P                  R 4       RRR4       RRR4       V P                  R4       V P	                  XP
                  4       V P	                  VP                  4       R#   + '       g   i     La; i  + '       g   i     Ll; i  \         d     Lki ; i)zbody of bad with executedNzRuntimeError not reraised)r[  rg  r  rM   r   r   r   rs  s   & r   testExceptionInEnterNestedWith.testExceptionInEnter  s    	3$4$4$6$6		56 %7
 II12'& %7$6 		s?   C B0B	B0C B-(B00C 	;C CCc           	        R pV P                  RR7      ;_uu_ 4       q P                  4       ;_uu_ 4        RpRRR4       RRR4       V P                  XP                  4       V P                  VP                  4       V P                  V4       V P                  VP                  ^ ,          R4       R#   + '       g   i     L; i  + '       g   i     L; i)FT)rU  N)r[  rn  r   r   r   assertNotEqualrQ   )r   body_executedr  s   &  r   testExceptionInExitNestedWith.testExceptionInExit  s    ZZtZ$$??+<+< M ,=$'&&AJJqM40 ,=+<$$s!   CB4	C4C?CC	c           	     x   V P                  RR7      ;_uu_ 4       w  rV P                  RR7      ;_uu_ 4       w  r4V P                  ^V4       V P                  ^V4       V P                  ^
V4       V P                  ^V4       RRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)rh  )r&   N)rh  r  )
      )r[  r   )r   a1a2b1b2s   &    r   testEnterReturnsTuple NestedWith.testEnterReturnsTuple"  s    ZZeZ$$ZZhZ''8BQ#Q#R$R$	 ( %$'' %$$s#   B(AB	B(B% B((B9	c           	     r  a  V 3R  lpV 3R lpV 3R lpVR3VR3VR33 F  w  rES P                  V4      ;_uu_ 4        V! 4       p\        P                  ! VP                  4      ^ ,          p^pVP                  p	S P                  VP                  V	P                  ^,           4       S P                  VP                  V	P                  ^,           4       S P                  VP                  VP                  V,
          VP                  V,
           V4       RRR4       EK  	  R#   + '       g   i     EK  ; i)c                  z  <  SP                  4       ;_uu_ 4        SP                  4       ;_uu_ 4       p SP                  4       ;_uu_ 4       p R R R 4       R R R 4       R R R 4       R #   + '       g   i     L"; i  + '       g   i     L-; i  + '       g   i     R # ; i  \         d   pTu R p?# R p?ii ; ir   )r[  r`  	Exception)r`  drZ   r   s      r   init_raises5NestedWith.testExceptionLocation.<locals>.init_raises1  sd    ZZ\\4??#4#4DJJLLA =I#4\\LL#4#4\\\ si   B# BA<	A)A<	BB# )A94A<	<BBB 	B#  B# #B:.B5/B:5B:c            	        <  SP                  4       ;_uu_ 4        SP                  4       ;_uu_ 4       p  R R R 4       R R R 4       R #   + '       g   i     L; i  + '       g   i     R # ; i  \         d   pTu R p?# R p?ii ; ir   )rg  r[  r  r  rZ   r   s     r   enter_raises6NestedWith.testExceptionLocation.<locals>.enter_raises8  sT    %%'' *6''''' O   A/ AA	AA/ AAA,	&A/ ,A/ /B:B;BBc            	        <  SP                  4       ;_uu_ 4        SP                  4       ;_uu_ 4       p  R R R 4       R R R 4       R #   + '       g   i     L; i  + '       g   i     R # ; i  \         d   pTu R p?# R p?ii ; ir   )rn  r[  r  r  s     r   exit_raises5NestedWith.testExceptionLocation.<locals>.exit_raises?  sR    __&&

 )5&&&&& r  zself.InitRaises()zself.EnterRaises()zself.ExitRaises()N)subTestr'   
extract_tbrX   __code__r   linenoco_firstlineno
end_linenolinecolno	end_colno)
r   r  r  r  r5   expectedexcfindentcos
   f         r   testExceptionLocation NestedWith.testExceptionLocation*  s    			 !,-@A ,.BC +-@A ND d##f(():):;A>]]  2+<+<q+@A  r/@/@1/DE  &(81;;;O!P!)+ $#	  $##s   CD$$D6r   N)r*   r+   r,   r-   r   r[  r`  rg  rn  rp  rt  rw  r|  r  r  r.   r/   r@   s   @r   rP  rP    sX      &1V 1,f ,<V <''	'1%(+ (+r   rP  __main__)"__doc__
__author__	__email__r|   rP   r'   unittestcollectionsr   
contextlibr   r   r   r   r   r   r8   r   r:   rD   rF   r^   TestCaserg   r   r  r7  r[  r  r  r9  rP  r*   mainr   r   r   <module>r     sO   O 
#	 	 
    L L

C1 C$6   !V !H0 0"5h'' 5D,06 ,0^1<X..0L 1<h?B8#4#4 ?BD@968I8I @9F63("3"3 63r)#x00 )#XCH$5$5 C2t+"" t+n zMMO r   