a zeg@sLdZdZdZddlZddlZddlmZddlmZm Z m Z GdddeZ d d Z Gd d d e Ze d dZGddde ZGdddeZGdddejZGddde ZGdddejeZGdddejeZGdddeejZGdddejZGdd d ejZGd!d"d"ejZGd#d$d$ejZed%krHedS)&z7Unit tests for the with statement specified in PEP 343.z Mike Blandzmbland at acm dot orgN)deque)_GeneratorContextManagercontextmanager nullcontextcs,eZdZfddZddZddZZS)MockContextManagercs"tj|d|_d|_d|_dSNF)super__init__ enter_called exit_called exit_argsselfargs __class__B/opt/bitninja-python-dojo/embedded/lib/python3.9/test/test_with.pyr s zMockContextManager.__init__cCsd|_t|SNT)r r __enter__rrrrrszMockContextManager.__enter__cCs"d|_|||f|_t||||Sr)r r r__exit__rtypevalue tracebackrrrrs  zMockContextManager.__exit__)__name__ __module__ __qualname__r rr __classcell__rrrrr s rcsfdd}|S)Ncs t||SN)r)rkwdsfuncrrhelper sz#mock_contextmanager..helperr)r#r$rr"rmock_contextmanagers r%c@seZdZddZdS) MockResourcecCsd|_d|_dSr)yieldedstoppedrrrrr &szMockResource.__init__Nrrrr rrrrr&%sr&ccs*t}zd|_|VWd|_nd|_0dSr)r&r'r()mockrrrmock_contextmanager_generator+s r+c@s$eZdZddZddZddZdS)NestedcGs||_d|_dSr )managersenteredrr-rrrr 7szNested.__init__cCsj|jdurtdt|_g}z*|jD]}|||j|q&Wn|jt s`Yn0|S)NzContext is not reentrant) r. RuntimeErrorrr-appendr appendleftrsysexc_info)rvarsmgrrrrr;s  zNested.__enter__cGsd|}|jD],}z|j|rd}Wq t}Yq 0q d|_||ur`|d|d|ddS)NNNNr)r.rr3r4with_traceback)rr4exr6rrrrIs  zNested.__exit__Nrrrr rrrrrrr,5sr,c@s$eZdZddZddZddZdS) MockNestedcGs(tj|g|Rd|_d|_d|_dSr)r,r r r r r/rrrr ZszMockNested.__init__cCsd|_t|Sr)r r,rrrrrr`szMockNested.__enter__cGsd|_||_tj|g|RSr)r r r,rrr4rrrrdszMockNested.__exit__Nr<rrrrr=Ysr=c@s\eZdZddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ dS)FailureTestCasecCsdd}|t|dS)NcSs(tWdn1s0YdSr foorrrrfooNotDeclaredlsz5FailureTestCase.testNameError..fooNotDeclared) assertRaises NameError)rrBrrr testNameErrorkszFailureTestCase.testNameErrorcs.Gdddtfdd}|td|dS)Nc@seZdZddZdS)z.LacksEntercSsdSr rrrrrrrszEFailureTestCase.testEnterAttributeError1..LacksEnter.__exit__N)rrrrrrrr LacksEnterqsrFcs.}|Wdn1s 0YdSr rr@rFrr fooLacksEnterusz?FailureTestCase.testEnterAttributeError1..fooLacksEnterrobjectassertRaisesRegexAttributeError)rrHrrGrtestEnterAttributeError1ps z(FailureTestCase.testEnterAttributeError1cs.Gdddtfdd}|td|dS)Nc@s eZdZdS)zCFailureTestCase.testEnterAttributeError2..LacksEnterAndExitNrrrrrrrLacksEnterAndExit{srOcs.}|Wdn1s 0YdSr rr@rOrrfooLacksEnterAndExit~szFFailureTestCase.testEnterAttributeError2..fooLacksEnterAndExitrrI)rrQrrPrtestEnterAttributeError2zs z(FailureTestCase.testEnterAttributeError2cs.Gdddtfdd}|td|dS)Nc@seZdZddZdS)z9FailureTestCase.testExitAttributeError..LacksExitcSsdSr rrrrrrszCFailureTestCase.testExitAttributeError..LacksExit.__enter__N)rrrrrrrr LacksExitsrScs.}|Wdn1s 0YdSr rr@rSrr fooLacksExitsz.fooLacksExitrrI)rrUrrTrtestExitAttributeErrors z&FailureTestCase.testExitAttributeErrorcCsdd}|t||dS)NcSst|dddS)NZsingle)compile)srrrshouldRaiseSyntaxErrorszGFailureTestCase.assertRaisesSyntaxError..shouldRaiseSyntaxError)rC SyntaxError)rZcodestrrZrrrassertRaisesSyntaxErrorsz'FailureTestCase.assertRaisesSyntaxErrorcCs|d|ddS)Nzwith mock as None: passzwith mock as (None): passr\rrrrtestAssignmentToNoneErrors z)FailureTestCase.testAssignmentToNoneErrorcCs|d|ddS)Nzwith mock as None,: passzwith mock as (None,): passr]rrrr,testAssignmentToTupleOnlyContainingNoneErrors z.EnterThrowscSs tddS)Nz Enter threwr0rrrrrsz>FailureTestCase.testEnterThrows..EnterThrows.__enter__cWsdSr rr rrrrsz=FailureTestCase.testEnterThrows..EnterThrows.__exit__Nrrrrrrrrr EnterThrowssrccs6}d_|_Wdn1s(0YdSr r@)ctrcrrr shouldThrowsz4FailureTestCase.testEnterThrows..shouldThrow)rJrCr0 assertEqualrArrfrrertestEnterThrowss zFailureTestCase.testEnterThrowscs,Gdddtfdd}|t|dS)Nc@seZdZddZddZdS)z2FailureTestCase.testExitThrows..ExitThrowscSsdSr rrrrrrsz.ExitThrows.__enter__cWs tddS)N*rar rrrrsz;FailureTestCase.testExitThrows..ExitThrows.__exit__Nrbrrrr ExitThrowssrkcs*Wdn1s0YdSr rrrkrrrfsz3FailureTestCase.testExitThrows..shouldThrow)rJrCr0rhrrlrtestExitThrowss zFailureTestCase.testExitThrowsN) rrrrErMrRrVr\r^r_r`rirmrrrrr?js   r?c@sVeZdZddZddZddZddZd d Zd d Zd dZ dddZ ddZ dS)ContextmanagerAssertionMixincCstd|_dS)Nztest exception)r0TEST_EXCEPTIONrrrrsetUpsz"ContextmanagerAssertionMixin.setUpcCs*||j||j||jddSr ) assertTruer assertFalser rgr r mock_managerrrrassertInWithManagerInvariantss  z:ContextmanagerAssertionMixin.assertInWithManagerInvariantscCs*||j||j||j|dSr )rqr r rgr )rrtr rrr assertAfterWithManagerInvariantss  z=ContextmanagerAssertionMixin.assertAfterWithManagerInvariantscCs||ddS)Nr7)rvrsrrr'assertAfterWithManagerInvariantsNoErrorszDContextmanagerAssertionMixin.assertAfterWithManagerInvariantsNoErrorcCs||j||jdSr )rqr'rrr(rZmock_generatorrrrassertInWithGeneratorInvariantss z||jd|jt|j}||jd|||jd|||jdddS)Nr8rr9) rqr r rgr rorZassertIsInstanceZ assertIsNot)rrtexc_typerrr)assertAfterWithManagerInvariantsWithErrors   zFContextmanagerAssertionMixin.assertAfterWithManagerInvariantsWithErrorcCs||j||jdSr rzrxrrr+assertAfterWithGeneratorInvariantsWithErrors zHContextmanagerAssertionMixin.assertAfterWithGeneratorInvariantsWithError)N) rrrrprurvrwryr{r|r~rrrrrrns rnc@sDeZdZddZddZddZddZd d Zd d Zd dZ dS)NonexceptionalTestCasecCs*tWdn1s0YdSr r+rrrrtestInlineGeneratorSyntaxsz0NonexceptionalTestCase.testInlineGeneratorSyntaxcCs8t}|Wdn1s 0Y||dSr )r+rw)rr*rrrtestUnboundGeneratorsz+NonexceptionalTestCase.testUnboundGeneratorcCs>t}||Wdn1s&0Y||dSr r+ryr{rrArrrtestInlineGeneratorBoundSyntaxs(z5NonexceptionalTestCase.testInlineGeneratorBoundSyntaxcCsBd}t}||Wdn1s*0Y||dSr rrrrr*testInlineGeneratorBoundToExistingVariables(zANonexceptionalTestCase.testInlineGeneratorBoundToExistingVariablecCsDt|_||jWdn1s*0Y||jdSr )r+rAryr{rrrr(testInlineGeneratorBoundToDottedVariables *z?NonexceptionalTestCase.testInlineGeneratorBoundToDottedVariablecCsVt}|$}||||Wdn1s40Y||||dSr )r+ryrur{rw)rr*rArrrtestBoundGenerators  ( z)NonexceptionalTestCase.testBoundGeneratorc Cst}|}t}|8}||||||||Wdn1sT0Y||||||||Wdn1s0Y||||dSr )r+ruryrwr{)rmock_arAmock_bbarrrrtestNestedSingleStatementss   (   ( z1NonexceptionalTestCase.testNestedSingleStatementsN) rrrrrrrrrrrrrrrsrc@sDeZdZddZddZddZddZd d Zd d Zd dZ dS)NestedNonexceptionalTestCasecCs.ttWdn1s 0YdSr r,r+rrrr"testSingleArgInlineGeneratorSyntax#s z?NestedNonexceptionalTestCase.testSingleArgInlineGeneratorSyntaxcCsFt}t|}||Wdn1s.0Y||dSr r+r,rurwrmrArrrtestSingleArgBoundToNonTuple's (z9NestedNonexceptionalTestCase.testSingleArgBoundToNonTuplecCsFt}t|}||Wdn1s.0Y||dSr rrrrr2testSingleArgBoundToSingleElementParenthesizedList/s (zONestedNonexceptionalTestCase.testSingleArgBoundToSingleElementParenthesizedListcCsdd}|t|dS)NcSs2tt\}}Wdn1s$0YdSr r)rArrrrshouldThrowValueError8sziNestedNonexceptionalTestCase.testSingleArgBoundToMultipleElementTupleError..shouldThrowValueError)rC ValueError)rrrrr-testSingleArgBoundToMultipleElementTupleError7szJNestedNonexceptionalTestCase.testSingleArgBoundToMultipleElementTupleErrorcCs^t}t|}|$||||Wdn1s<0Y||||dSr r+r=rurw)rr% mock_nestedrrrtestSingleArgUnbound=s ( z1NestedNonexceptionalTestCase.testSingleArgUnboundcCst}t}t}t|||}|8||||||||Wdn1s`0Y||||||||dSr r)rrnorrrrtestMultipleArgUnboundFs    (   z3NestedNonexceptionalTestCase.testMultipleArgUnboundcCstttt}|>\}}}||||||||Wdn1sZ0Y||||||||dSr )r=r+ryrur{rw)rrrrrrrrtestMultipleArgBoundUs    (   z1NestedNonexceptionalTestCase.testMultipleArgBoundN) rrrrrrrrrrrrrrr!s rc@sleZdZddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ ddZdS)ExceptionalTestCasecs:tfdd}t|jdS)NcsH0_jWdn1s:0YdSr )resourceruryr|rcmrrrrffs  z;ExceptionalTestCase.testSingleResource..shouldThrow)r+rCr0r~rrrhrrrtestSingleResourceds   z&ExceptionalTestCase.testSingleResourcecs0tfdd}t|tdS)Ncs2_ddWdn1s$0YdSNr8r)rrrrrrfqsz@ExceptionalTestCase.testExceptionNormalized..shouldThrow)r+rCZeroDivisionErrorr~rhrrrtestExceptionNormalizedos z+ExceptionalTestCase.testExceptionNormalizedcsXttfdd}t|jjdS)Nc sl_F_jjWdn1sX0YWdn1sv0YdSr rArruryr|rrrrrrrf|s    zCExceptionalTestCase.testNestedSingleStatements..shouldThrow)r+rCr0r~rrArrhrrrrys    z.ExceptionalTestCase.testNestedSingleStatementscsntttfdd}t|jjdS)NcsnV\__jjWdn1s`0YdSr ) resource_a resource_bruryr|rZcm_aZcm_brrrrrfs     zOExceptionalTestCase.testMultipleResourcesInSingleStatement..shouldThrow)r+r=rCr0r~rrrrhrrr&testMultipleResourcesInSingleStatements      z:ExceptionalTestCase.testMultipleResourcesInSingleStatementcs|ttd_fdd}t|jjdj j j ddS)Nc snV_j_Wdn1sB0YWdn1s`0YdSr )rAruryr|rrrrrrfs   zPExceptionalTestCase.testNestedExceptionBeforeInnerStatement..shouldThrow) r+rrCr0r~rrArgrrr r r rhrrr'testNestedExceptionBeforeInnerStatements     z;ExceptionalTestCase.testNestedExceptionBeforeInnerStatementcsXttfdd}t|jjdS)Nc sl_>_jjWdn1sP0YWdn1sv0YdSr rrrrrrfs   *zOExceptionalTestCase.testNestedExceptionAfterInnerStatement..shouldThrow) r+rCr0r~rwrrAr{rrhrrr&testNestedExceptionAfterInnerStatements    z:ExceptionalTestCase.testNestedExceptionAfterInnerStatementcsNtddfdd}|td|Wdn1s@0YdS)Ncss dVdSr rrrrrrsz8ExceptionalTestCase.testRaisedStopIteration1..cmcs2tdWdn1s$0YdSN from with StopIterationrrrrrfszAExceptionalTestCase.testRaisedStopIteration1..shouldThrowr)rrKrrhrrrtestRaisedStopIteration1s   z,ExceptionalTestCase.testRaisedStopIteration1csRGdddtfdd}|td|Wdn1sD0YdS)Nc@seZdZddZddZdS)z8ExceptionalTestCase.testRaisedStopIteration2..cmcSsdSr rrrrrrszBExceptionalTestCase.testRaisedStopIteration2..cm.__enter__cSsdSr rrrrrrszAExceptionalTestCase.testRaisedStopIteration2..cm.__exit__Nrbrrrrrsrcs2tdWdn1s$0YdSrrrrrrrfszAExceptionalTestCase.testRaisedStopIteration2..shouldThrowr)rJrKrrhrrrtestRaisedStopIteration2s z,ExceptionalTestCase.testRaisedStopIteration2csLtddfdd}|t|Wdn1s>0YdS)Ncss dVdSr rrrrrrsz8ExceptionalTestCase.testRaisedStopIteration3..cmcs6ttgWdn1s(0YdSr )nextiterrrrrrfszAExceptionalTestCase.testRaisedStopIteration3..shouldThrow)rrCrrhrrrtestRaisedStopIteration3s    z,ExceptionalTestCase.testRaisedStopIteration3cs(tddfdd}|t|dS)Ncss dVdSr rrrrrrsz8ExceptionalTestCase.testRaisedGeneratorExit1..cmcs2tdWdn1s$0YdSr GeneratorExitrrrrrfszAExceptionalTestCase.testRaisedGeneratorExit1..shouldThrow)rrCrrhrrrtestRaisedGeneratorExit1s  z,ExceptionalTestCase.testRaisedGeneratorExit1cs,Gdddtfdd}|t|dS)Nc@seZdZddZddZdS)z8ExceptionalTestCase.testRaisedGeneratorExit2..cmcSsdSr rrrrrrszBExceptionalTestCase.testRaisedGeneratorExit2..cm.__enter__cSsdSr rrrrrrszAExceptionalTestCase.testRaisedGeneratorExit2..cm.__exit__Nrbrrrrrsrcs2tdWdn1s$0YdSrrrrrrrfszAExceptionalTestCase.testRaisedGeneratorExit2..shouldThrow)rJrCrrhrrrtestRaisedGeneratorExit2s z,ExceptionalTestCase.testRaisedGeneratorExit2cs\Gdddtfdd}|fdd}t|fdd}t|dS) Nc@s$eZdZddZddZddZdS)z0ExceptionalTestCase.testErrorsInBool..cmcsGfddd}||_dS)NcseZdZfddZdS)zGExceptionalTestCase.testErrorsInBool..cm.__init__..BoolcsSr rrbool_conversionrr__bool__szPExceptionalTestCase.testErrorsInBool..cm.__init__..Bool.__bool__N)rrrrrrrrBool srZ exit_result)rrrrrrr sz9ExceptionalTestCase.testErrorsInBool..cm.__init__cSsdS)Nrrrrrrsz:ExceptionalTestCase.testErrorsInBool..cm.__enter__cSs|jSr rrabcrrrrsz9ExceptionalTestCase.testErrorsInBool..cm.__exit__Nr<rrrrr srcs:dddWdn1s,0YdS)NcSsdSrrrrrrzJExceptionalTestCase.testErrorsInBool..trueAsBool..Should NOT see thisfailrrrr trueAsBoolsz8ExceptionalTestCase.testErrorsInBool..trueAsBoolcs:dddWdn1s,0YdS)NcSsdSrrrrrrrrzKExceptionalTestCase.testErrorsInBool..falseAsBool..z Should raiserrrrr falseAsBoolsz9ExceptionalTestCase.testErrorsInBool..falseAsBoolcs:dddWdn1s,0YdS)NcSsddSrrrrrrr!rzJExceptionalTestCase.testErrorsInBool..failAsBool..rrrrrr failAsBool sz8ExceptionalTestCase.testErrorsInBool..failAsBool)rJrCAssertionErrorr)rrrrrrrtestErrorsInBools  z$ExceptionalTestCase.testErrorsInBoolN)rrrrrrrrrrrrrrrrrrrrcs    rc@s4eZdZddZddZddZddZd d Zd S) NonLocalFlowControlTestCasecCsbd}|d7}t&|d7}WdqRWdn1s>0Y|d7}q||ddS)Nrr8 d r+rgrcounterrrr testWithBreak(s, z)NonLocalFlowControlTestCase.testWithBreakcCsld}|d7}|dkrq\t&|d7}WdqWdn1sH0Y|d7}q||ddS)Nrr8r9rr rrrrrtestWithContinue2s, z,NonLocalFlowControlTestCase.testWithContinuecCsdd}||ddS)NcSsLd}|d7}t|d7}|WdS1s40Y|d7}qdS)Nrr8rrr)rrrrrA?s "z7NonLocalFlowControlTestCase.testWithReturn..foor)rgrrrrtestWithReturn>sz*NonLocalFlowControlTestCase.testWithReturncCs&dd}t|}||ddgdS)Ncss6tdVdVWdn1s(0YdS)Nr rrrrrgenJsz6NonLocalFlowControlTestCase.testWithYield..genrr)listrg)rrxrrr testWithYieldIs z)NonLocalFlowControlTestCase.testWithYieldcCsxd}zF|d7}t|d7}tWdn1s60Y|d7}Wntyh||dYn 0|ddS)Nrr8rrrzDidn't raise RuntimeError)r+r0rgrrrrr testWithRaiseQs"  z)NonLocalFlowControlTestCase.testWithRaiseN)rrrrrrrrrrrrr&s    rc@s$eZdZddZddZddZdS)AssignmentTargetTestCasecCsldgdi}tD|dd<|t|dg||ddjtWdn1s\0YtLt|dd<|t|dg||ddjtWdn1s0Yt8|d<t|}|||ddgWdn1s0YGddd}|}t$|_|t |ddWdn1s^0YdS) Nr8rr8r9rr9c@s eZdZdS)z;AssignmentTargetTestCase.testSingleComplexTarget..CNrNrrrrCmrrrAT) r+rgrkeysrr&valuessortrAhasattr)rtargetsrrblahrrrtestSingleComplexTargetas 44  0 z0AssignmentTargetTestCase.testSingleComplexTargetcCsGddd}dgdi}|B\|dd<|dd<|dd<||dgdiWdn1sh0Y|Z\t|dd<t|dd<t|dd<||dgdiWdn1s0Y|6\|d<|d<|d <||ddd dWdn1s&0YGd d d }|}|F\|_|_|_||jd||jd||jd Wdn1s0YdS) Nc@seZdZddZddZdS)z>AssignmentTargetTestCase.testMultipleComplexTargets..CcSsdS)Nr8r9rrrrrrrtrzHAssignmentTargetTestCase.testMultipleComplexTargets..C.__enter__cSsdSr rrtvtbrrrrurzGAssignmentTargetTestCase.testMultipleComplexTargets..C.__exit__Nrbrrrrrssrr8rrr9r)rr9r8rc@s eZdZdS)z>AssignmentTargetTestCase.testMultipleComplexTargets..BNrNrrrrB}rr)rgrrZoneZtwoZthree)rrrrrrrrtestMultipleComplexTargetsrs &2>24z3AssignmentTargetTestCase.testMultipleComplexTargetscCsbttdd@^}}}||d||ddg||dWdn1sT0YdS)Nr8r9r)rrangergrrrrtestWithExtendedTargetss z0AssignmentTargetTestCase.testWithExtendedTargetsN)rrrrrrrrrrr_src@seZdZddZddZdS)ExitSwallowsExceptionTestCasecCsbGddd}z2|ddWdn1s40YWnty\|dYn0dS)Nc@seZdZddZddZdS)zSExitSwallowsExceptionTestCase.testExitTrueSwallowsException..AfricanSwallowcSsdSr rrrrrrrz]ExitSwallowsExceptionTestCase.testExitTrueSwallowsException..AfricanSwallow.__enter__cSsdSrrrrrrrrz\ExitSwallowsExceptionTestCase.testExitTrueSwallowsException..AfricanSwallow.__exit__NrbrrrrAfricanSwallowsrr8rz,ZeroDivisionError should have been swallowedrr)rrrrrtestExitTrueSwallowsExceptions * z;ExitSwallowsExceptionTestCase.testExitTrueSwallowsExceptioncCsbGddd}z2|ddWdn1s40YWntyRYn 0|ddS)Nc@seZdZddZddZdS)zZExitSwallowsExceptionTestCase.testExitFalseDoesntSwallowException..EuropeanSwallowcSsdSr rrrrrrrzdExitSwallowsExceptionTestCase.testExitFalseDoesntSwallowException..EuropeanSwallow.__enter__cSsdSrrrrrrrrzcExitSwallowsExceptionTestCase.testExitFalseDoesntSwallowException..EuropeanSwallow.__exit__NrbrrrrEuropeanSwallowsrr8rz)ZeroDivisionError should have been raisedr)rrrrr#testExitFalseDoesntSwallowExceptions* zAExitSwallowsExceptionTestCase.testExitFalseDoesntSwallowExceptionN)rrrrrrrrrrs rc@steZdZGdddeZGdddeZGdddeZGdddeZd d Zd d Z d dZ ddZ ddZ dS) NestedWithc@s&eZdZd ddZddZddZdS) zNestedWith.DummyNFcCs(|dur |}||_||_d|_d|_dSr)rgobbler r )rrrrrrr s zNestedWith.Dummy.__init__cCs d|_|jSr)r rrrrrrszNestedWith.Dummy.__enter__cGsd|_||_|jrdSdSr)r r4rr>rrrrszNestedWith.Dummy.__exit__)NFr<rrrrDummys rc@seZdZddZdS)zNestedWith.InitRaisescCs tdSr rarrrrr rzNestedWith.InitRaises.__init__Nr)rrrr InitRaisessrc@seZdZddZddZdS)zNestedWith.EnterRaisescCs tdSr rarrrrrrz NestedWith.EnterRaises.__enter__cGsdSr rr>rrrrrzNestedWith.EnterRaises.__exit__Nrbrrrr EnterRaisessrc@seZdZddZddZdS)zNestedWith.ExitRaisescCsdSr rrrrrrrzNestedWith.ExitRaises.__enter__cGs tdSr rar>rrrrrzNestedWith.ExitRaises.__exit__Nrbrrrr ExitRaisessrc Cs|P}|(}||j||jWdn1s@0YWdn1s^0Y||j||jdSr )rrqr r )rrrrrrtestNoExceptionss  H zNestedWith.testNoExceptionsc Cs~zT|8}|Wdn1s*0YWdn1sH0YWn Yn0||j||jdSr )rrrqr r rrrrrtestExceptionInExprLists@ z"NestedWith.testExceptionInExprListc Csz^|B}||dWdn1s40YWdn1sR0YWntypYn 0|d||j||jdS)Nzbody of bad with executedzRuntimeError not reraised)rrrr0rqr r rrrrtestExceptionInEntersJ   zNestedWith.testExceptionInEnterc Csd}|jdd<}|d}Wdn1s40YWdn1sR0Y||j||j||||jdddS)NFT)rr)rrrqr r ZassertNotEqualr4)rZ body_executedrrrrtestExceptionInExits@   zNestedWith.testExceptionInExitc Cs|jddt\}}|jddD\}}|d||d||d||d|Wdn1sh0YWdn1s0YdS)N)r8r9)r)rr8r9rr )rrg)rZa1Za2b1b2rrrtestEnterReturnsTuples    z NestedWith.testEnterReturnsTupleN) rrrrJrrrrrrrrr rrrrrs   r__main__)__doc__ __author__Z __email__r3Zunittest collectionsr contextlibrrrrr%rJr&r+r,r=ZTestCaser?rnrrrrrrrrmainrrrrs6  $S/5BD9,L