{G_Tc@sdZdZdZddlZddlZddlmZddlmZm Z ddl m Z defd YZ d Z d efd YZe d ZdefdYZdefdYZdejfdYZdefdYZdejefdYZdejefdYZdejefdYZdejfdYZdejfdYZd ejfd!YZd"ejfd#YZd$Zed%krendS(&s7Unit tests for the with statement specified in PEP 343.s Mike Blandsmbland at acm dot orgiN(tdeque(tGeneratorContextManagertcontextmanager(t run_unittesttMockContextManagercBs#eZdZdZdZRS(cCs/tj||t|_t|_d|_dS(N(Rt__init__tFalset enter_calledt exit_calledtNonet exit_args(tselftgen((s*/usr/local/lib/python2.7/test/test_with.pyRs  cCst|_tj|S(N(tTrueRRt __enter__(R ((s*/usr/local/lib/python2.7/test/test_with.pyRs cCs1t|_|||f|_tj||||S(N(R RR Rt__exit__(R ttypetvaluet traceback((s*/usr/local/lib/python2.7/test/test_with.pyRs  (t__name__t __module__RRR(((s*/usr/local/lib/python2.7/test/test_with.pyRs  csfd}|S(Ncst||S(N(R(targstkwds(tfunc(s*/usr/local/lib/python2.7/test/test_with.pythelper!s((RR((Rs*/usr/local/lib/python2.7/test/test_with.pytmock_contextmanager st MockResourcecBseZdZRS(cCst|_t|_dS(N(Rtyieldedtstopped(R ((s*/usr/local/lib/python2.7/test/test_with.pyR's (RRR(((s*/usr/local/lib/python2.7/test/test_with.pyR&sccs,t}zt|_|VWdt|_XdS(N(RR RR(tmock((s*/usr/local/lib/python2.7/test/test_with.pytmock_contextmanager_generator,s    tNestedcBs#eZdZdZdZRS(cGs||_d|_dS(N(tmanagersR tentered(R R ((s*/usr/local/lib/python2.7/test/test_with.pyR8s cCs|jdk rtdnt|_g}y;x4|jD])}|j|j|jj|q=WWn"|jt j sqnX|S(NsContext is not reentrant( R!R t RuntimeErrorRR tappendRt appendleftRtsystexc_info(R tvarstmgr((s*/usr/local/lib/python2.7/test/test_with.pyR<s  cGs|}xC|jD]8}y|j|r1d}nWqtj}qXqWd|_||k r||d|d|dndS(Niii(NNN(R!RR R%R&(R R&texR(((s*/usr/local/lib/python2.7/test/test_with.pyRJs   (RRRRR(((s*/usr/local/lib/python2.7/test/test_with.pyR6s  t MockNestedcBs#eZdZdZdZRS(cGs/tj||t|_t|_d|_dS(N(RRRRRR R (R R ((s*/usr/local/lib/python2.7/test/test_with.pyR[s  cCst|_tj|S(N(R RRR(R ((s*/usr/local/lib/python2.7/test/test_with.pyRas cGs"t|_||_tj||S(N(R RR RR(R R&((s*/usr/local/lib/python2.7/test/test_with.pyRes  (RRRRR(((s*/usr/local/lib/python2.7/test/test_with.pyR*Zs  tFailureTestCasecBsbeZdZdZdZdZdZdZdZdZ dZ d Z RS( cCsd}|jt|dS(NcSstWdQXdS(N(tfoo(((s*/usr/local/lib/python2.7/test/test_with.pytfooNotDeclaredms(t assertRaisest NameError(R R-((s*/usr/local/lib/python2.7/test/test_with.pyt testNameErrorls cs9dtfdYfd}|jt|dS(Nt LacksEntercBseZdZRS(cSsdS(N((R RRR((s*/usr/local/lib/python2.7/test/test_with.pyRss(RRR(((s*/usr/local/lib/python2.7/test/test_with.pyR1rscs}|WdQXdS(N((R,(R1(s*/usr/local/lib/python2.7/test/test_with.pyt fooLacksEntervs (tobjectR.tAttributeError(R R2((R1s*/usr/local/lib/python2.7/test/test_with.pyttestEnterAttributeErrorqscs9dtfdYfd}|jt|dS(Nt LacksExitcBseZdZRS(cSsdS(N((R ((s*/usr/local/lib/python2.7/test/test_with.pyR}s(RRR(((s*/usr/local/lib/python2.7/test/test_with.pyR6|scs}|WdQXdS(N((R,(R6(s*/usr/local/lib/python2.7/test/test_with.pyt fooLacksExits (R3R.R4(R R7((R6s*/usr/local/lib/python2.7/test/test_with.pyttestExitAttributeError{scCs d}|jt||dS(NcSst|dddS(Nttsingle(tcompile(ts((s*/usr/local/lib/python2.7/test/test_with.pytshouldRaiseSyntaxErrors(R.t SyntaxError(R tcodestrR=((s*/usr/local/lib/python2.7/test/test_with.pytassertRaisesSyntaxErrors cCs|jd|jddS(Nswith mock as None: passswith mock as (None): pass(R@(R ((s*/usr/local/lib/python2.7/test/test_with.pyttestAssignmentToNoneErrors cCs|jddS(Nswith mock as (): pass(R@(R ((s*/usr/local/lib/python2.7/test/test_with.pyttestAssignmentToEmptyTupleErrorscCs|jd|jddS(Nswith mock as None,: passswith mock as (None,): pass(R@(R ((s*/usr/local/lib/python2.7/test/test_with.pyt,testAssignmentToTupleOnlyContainingNoneErrors cCs|jddS(Ns%with mock as (foo, None, bar): pass(R@(R ((s*/usr/local/lib/python2.7/test/test_with.pyt(testAssignmentToTupleContainingNoneErrorscsOdtfdYfd}jt|jjddS(Nt EnterThrowscBseZdZdZRS(cSstddS(Ns Enter threw(R"(R ((s*/usr/local/lib/python2.7/test/test_with.pyRscWsdS(N((R R((s*/usr/local/lib/python2.7/test/test_with.pyRs(RRRR(((s*/usr/local/lib/python2.7/test/test_with.pyREs cs(}d_| _WdQXdS(N(R R,(tct(RER (s*/usr/local/lib/python2.7/test/test_with.pyt shouldThrows   (R3R.R"t assertEqualR,R (R RG((RER s*/usr/local/lib/python2.7/test/test_with.pyttestEnterThrowsscs9dtfdYfd}|jt|dS(Nt ExitThrowscBseZdZdZRS(cSsdS(N((R ((s*/usr/local/lib/python2.7/test/test_with.pyRscWstddS(Ni*(R"(R R((s*/usr/local/lib/python2.7/test/test_with.pyRs(RRRR(((s*/usr/local/lib/python2.7/test/test_with.pyRJs csWdQXdS(N(((RJ(s*/usr/local/lib/python2.7/test/test_with.pyRGs (R3R.R"(R RG((RJs*/usr/local/lib/python2.7/test/test_with.pyttestExitThrowss( RRR0R5R8R@RARBRCRDRIRK(((s*/usr/local/lib/python2.7/test/test_with.pyR+ks       tContextmanagerAssertionMixincBs_eZedZdZdZdZdZdZdZ d dZ dZ RS( stest exceptioncCs7|j|j|j|j|j|jddS(N(t assertTrueRt assertFalseRRHR R (R t mock_manager((s*/usr/local/lib/python2.7/test/test_with.pytassertInWithManagerInvariantsscCs7|j|j|j|j|j|j|dS(N(RMRRRHR (R ROR ((s*/usr/local/lib/python2.7/test/test_with.pyt assertAfterWithManagerInvariantsscCs|j|ddS(N(NNN(RQR (R RO((s*/usr/local/lib/python2.7/test/test_with.pyt'assertAfterWithManagerInvariantsNoErrors cCs$|j|j|j|jdS(N(RMRRNR(R tmock_generator((s*/usr/local/lib/python2.7/test/test_with.pytassertInWithGeneratorInvariantsscCs$|j|j|j|jdS(N(RMRR(R RS((s*/usr/local/lib/python2.7/test/test_with.pyt)assertAfterWithGeneratorInvariantsNoErrorscCs |jdS(N(tTEST_EXCEPTION(R ((s*/usr/local/lib/python2.7/test/test_with.pytraiseTestExceptionscCs|j|j|j|j|dkrX|j|jd|jt|j}n|j|jd||j|jd||j |jdddS(Niii( RMRRR RHR RVRtassertIsInstancet assertIsNot(R ROtexc_type((s*/usr/local/lib/python2.7/test/test_with.pyt)assertAfterWithManagerInvariantsWithErrors cCs$|j|j|j|jdS(N(RMRR(R RS((s*/usr/local/lib/python2.7/test/test_with.pyt+assertAfterWithGeneratorInvariantsWithErrorsN( RRR"RVRPRQRRRTRURWR R[R\(((s*/usr/local/lib/python2.7/test/test_with.pyRLs        tNonexceptionalTestCasecBsGeZdZdZdZdZdZdZdZRS(cCstWdQXdS(N(R(R ((s*/usr/local/lib/python2.7/test/test_with.pyttestInlineGeneratorSyntaxs cCs't}|WdQX|j|dS(N(RRR(R R((s*/usr/local/lib/python2.7/test/test_with.pyttestUnboundGenerators cCs0t}|j|WdQX|j|dS(N(RRTRU(R R,((s*/usr/local/lib/python2.7/test/test_with.pyttestInlineGeneratorBoundSyntaxs cCs6d}t}|j|WdQX|j|dS(N(R RRTRU(R R,((s*/usr/local/lib/python2.7/test/test_with.pyt*testInlineGeneratorBoundToExistingVariables cCs9t|_|j|jWdQX|j|jdS(N(RR,RTRU(R ((s*/usr/local/lib/python2.7/test/test_with.pyt(testInlineGeneratorBoundToDottedVariablescCsPt}|!}|j||j|WdQX|j||j|dS(N(RRTRPRURR(R RR,((s*/usr/local/lib/python2.7/test/test_with.pyttestBoundGenerators     c Cst}|}t}|;}|j||j||j||j|WdQX|j||j||j||j|WdQX|j||j|dS(N(RRPRTRRRU(R tmock_aR,tmock_btbar((s*/usr/local/lib/python2.7/test/test_with.pyttestNestedSingleStatements s           ( RRR^R_R`RaRbRcRg(((s*/usr/local/lib/python2.7/test/test_with.pyR]s      tNestedNonexceptionalTestCasecBsGeZdZdZdZdZdZdZdZRS(cCsttWdQXdS(N(RR(R ((s*/usr/local/lib/python2.7/test/test_with.pyt"testSingleArgInlineGeneratorSyntaxscCs<t}t|}|j|WdQX|j|dS(N(RRRPRR(R tmR,((s*/usr/local/lib/python2.7/test/test_with.pyttestSingleArgBoundToNonTuple"s cCs<t}t|}|j|WdQX|j|dS(N(RRRPRR(R RjR,((s*/usr/local/lib/python2.7/test/test_with.pyt2testSingleArgBoundToSingleElementParenthesizedList*s cCsd}|jt|dS(NcSs"tt \}}WdQXdS(N(RR(R,Rf((s*/usr/local/lib/python2.7/test/test_with.pytshouldThrowValueError3s(R.t ValueError(R Rm((s*/usr/local/lib/python2.7/test/test_with.pyt-testSingleArgBoundToMultipleElementTupleError2s cCsZt}t|}||j||j|WdQX|j||j|dS(N(RR*RPRR(R Rt mock_nested((s*/usr/local/lib/python2.7/test/test_with.pyttestSingleArgUnbound8s    cCst}t}t}t|||}|9|j||j||j||j|WdQX|j||j||j||j|dS(N(RR*RPRR(R RjtntoRp((s*/usr/local/lib/python2.7/test/test_with.pyttestMultipleArgUnboundAs         cCstttt}|D\}}}|j||j||j||j|WdQX|j||j||j||j|dS(N(R*RRTRPRURR(R RpRjRrRs((s*/usr/local/lib/python2.7/test/test_with.pyttestMultipleArgBoundPs       ( RRRiRkRlRoRqRtRu(((s*/usr/local/lib/python2.7/test/test_with.pyRhs     tExceptionalTestCasecBsteZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z RS( csLtfd}jt|jjjdS(Ncs=1_jjjjWdQXdS(N(tresourceRPRTRW((tcmR (s*/usr/local/lib/python2.7/test/test_with.pyRGas  (RR.R"R[R\Rw(R RG((RxR s*/usr/local/lib/python2.7/test/test_with.pyttestSingleResource_s   cs?tfd}jt|jtdS(Ncs_ddWdQXdS(Nii(Rw((RxR (s*/usr/local/lib/python2.7/test/test_with.pyRGls (RR.tZeroDivisionErrorR[(R RG((RxR s*/usr/local/lib/python2.7/test/test_with.pyttestExceptionNormalizedjs csuttfd}jt|jjjjjjdS(Nc sl`_N_jjjjjjjWdQXWdQXdS(N(R,RfRPRTRW((RdReR (s*/usr/local/lib/python2.7/test/test_with.pyRGws    (RR.R"R[R\R,Rf(R RG((RdReR s*/usr/local/lib/python2.7/test/test_with.pyRgts    cstttfd}jt|jjjjjjjdS(Ncspd\__jjjjjjjjWdQXdS(N(t resource_at resource_bRPRTRW((tcm_atcm_bRpR (s*/usr/local/lib/python2.7/test/test_with.pyRGs   (RR*R.R"R[R\R|R}(R RG((R~RRpR s*/usr/local/lib/python2.7/test/test_with.pyt&testMultipleResourcesInSingleStatements     csttd_fd}jt|jjjjjdj j j j jj ddS(Nc sOC_jjjj _WdQXWdQXdS(N(R,RPRTRWRf((RdReR (s*/usr/local/lib/python2.7/test/test_with.pyRGs     ( RR RfR.R"R[R\R,RHRNRRR (R RG((RdReR s*/usr/local/lib/python2.7/test/test_with.pyt'testNestedExceptionBeforeInnerStatements    csuttfd}jt|jjjjjjdS(Nc sl`_D_jjjjjjWdQXjWdQXdS(N(R,RfRPRTRW((RdReR (s*/usr/local/lib/python2.7/test/test_with.pyRGs    ( RR.R"R[RRR\R,RURf(R RG((RdReR s*/usr/local/lib/python2.7/test/test_with.pyt&testNestedExceptionAfterInnerStatements    cs2tdfd}|jt|dS(Ncss dVdS(N((((s*/usr/local/lib/python2.7/test/test_with.pyRxscs tdWdQXdS(Ns from with(t StopIteration((Rx(s*/usr/local/lib/python2.7/test/test_with.pyRGs (RR.R(R RG((Rxs*/usr/local/lib/python2.7/test/test_with.pyttestRaisedStopIteration1scs9dtfdYfd}|jt|dS(NRxcBseZdZdZRS(cSsdS(N((R ((s*/usr/local/lib/python2.7/test/test_with.pyRscSsdS(N((R RRR((s*/usr/local/lib/python2.7/test/test_with.pyRs(RRRR(((s*/usr/local/lib/python2.7/test/test_with.pyRxs cs tdWdQXdS(Ns from with(R((Rx(s*/usr/local/lib/python2.7/test/test_with.pyRGs (R3R.R(R RG((Rxs*/usr/local/lib/python2.7/test/test_with.pyttestRaisedStopIteration2scs2tdfd}|jt|dS(Ncss dVdS(N((((s*/usr/local/lib/python2.7/test/test_with.pyRxscs&tgjWdQXdS(N(titertnext((Rx(s*/usr/local/lib/python2.7/test/test_with.pyRGs (RR.R(R RG((Rxs*/usr/local/lib/python2.7/test/test_with.pyttestRaisedStopIteration3scs2tdfd}|jt|dS(Ncss dVdS(N((((s*/usr/local/lib/python2.7/test/test_with.pyRxscs tdWdQXdS(Ns from with(t GeneratorExit((Rx(s*/usr/local/lib/python2.7/test/test_with.pyRGs (RR.R(R RG((Rxs*/usr/local/lib/python2.7/test/test_with.pyttestRaisedGeneratorExit1scs9dtfdYfd}|jt|dS(NRxcBseZdZdZRS(cSsdS(N((R ((s*/usr/local/lib/python2.7/test/test_with.pyRscSsdS(N((R RRR((s*/usr/local/lib/python2.7/test/test_with.pyRs(RRRR(((s*/usr/local/lib/python2.7/test/test_with.pyRxs cs tdWdQXdS(Ns from with(R((Rx(s*/usr/local/lib/python2.7/test/test_with.pyRGs (R3R.R(R RG((Rxs*/usr/local/lib/python2.7/test/test_with.pyttestRaisedGeneratorExit2scswdtfdYfd}|fd}jt|fd}jt|dS(NRxcBs#eZdZdZdZRS(cs)ddfdY}||_dS(NtBoolcseZfdZRS(csS(N((R (tbool_conversion(s*/usr/local/lib/python2.7/test/test_with.pyt __nonzero__s(RRR((R(s*/usr/local/lib/python2.7/test/test_with.pyRs((t exit_result(R RR((Rs*/usr/local/lib/python2.7/test/test_with.pyRscSsdS(Ni((R ((s*/usr/local/lib/python2.7/test/test_with.pyR scSs|jS(N(R(R tatbtc((s*/usr/local/lib/python2.7/test/test_with.pyR s(RRRRR(((s*/usr/local/lib/python2.7/test/test_with.pyRxs  cs'djdWdQXdS(NcSstS(N(R (((s*/usr/local/lib/python2.7/test/test_with.pytssShould NOT see this(tfail((RxR (s*/usr/local/lib/python2.7/test/test_with.pyt trueAsBoolscs'djdWdQXdS(NcSstS(N(R(((s*/usr/local/lib/python2.7/test/test_with.pyRss Should raise(R((RxR (s*/usr/local/lib/python2.7/test/test_with.pyt falseAsBoolscs'djdWdQXdS(NcSsddS(Nii((((s*/usr/local/lib/python2.7/test/test_with.pyRssShould NOT see this(R((RxR (s*/usr/local/lib/python2.7/test/test_with.pyt failAsBools(R3R.tAssertionErrorRz(R RRR((RxR s*/usr/local/lib/python2.7/test/test_with.pyttestErrorsInBools (RRRyR{RgRRRRRRRRR(((s*/usr/local/lib/python2.7/test/test_with.pyRv^s      tNonLocalFlowControlTestCasecBs5eZdZdZdZdZdZRS(cCsVd}x9trA|d7}t|d7}PWdQX|d7}q W|j|ddS(Niii idi (R RRH(R tcounter((s*/usr/local/lib/python2.7/test/test_with.pyt testWithBreak s    cCshd}xKtrS|d7}|dkr)Pnt|d7}w WdQX|d7}q W|j|ddS(Niiii idi (R RRH(R R((s*/usr/local/lib/python2.7/test/test_with.pyttestWithContinue*s      cCs d}|j|ddS(NcSsId}x<trD|d7}t|d7}|SWdQX|d7}q WdS(Niii id(R R(R((s*/usr/local/lib/python2.7/test/test_with.pyR,7s     i (RH(R R,((s*/usr/local/lib/python2.7/test/test_with.pyttestWithReturn6s cCs2d}t|}|j|ddgdS(NcsstdVdVWdQXdS(Ni i (R(((s*/usr/local/lib/python2.7/test/test_with.pyR Bs i i (tlistRH(R R tx((s*/usr/local/lib/python2.7/test/test_with.pyt testWithYieldAs cCssd}y8|d7}t|d7}tWdQX|d7}Wn!tk ra|j|dnX|jddS(Niii idi sDidn't raise RuntimeError(RR"RHR(R R((s*/usr/local/lib/python2.7/test/test_with.pyt testWithRaiseIs     (RRRRRRR(((s*/usr/local/lib/python2.7/test/test_with.pyRs  tAssignmentTargetTestCasecBseZdZdZRS(c CsHidddgd6}tC|dd<|j|jdg|j|ddjtWdQXtI|jdd<|j|jdg|j|ddjtWdQXt7|d<|j}|j|j|ddgWdQXdddY}|}t#|_|jt|dt WdQXdS(NiiitCcBseZRS((RR(((s*/usr/local/lib/python2.7/test/test_with.pyResR,(( RRHtkeyst __class__RtvaluestsortR,thasattrR (R ttargetsRRtblah((s*/usr/local/lib/python2.7/test/test_with.pyttestSingleComplexTargetYs!!   c Csdd dY}idddgd6}|H\|dd<|dd<|dd<|j|idddgd6WdQX|Z\|jdd<|jdd<|jdd<|j|idddgd6WdQX|A\|d<|d<|d<|j|idd6dd6dd6WdQXdd dY}|}|R\|_|_|_|j|jd|j|jd|j|jdWdQXdS( NRcBseZdZdZRS(cSsdS(Niii(iii((R ((s*/usr/local/lib/python2.7/test/test_with.pyRlscSsdS(N((R tttvttb((s*/usr/local/lib/python2.7/test/test_with.pyRms(RRRR(((s*/usr/local/lib/python2.7/test/test_with.pyRks iiiitBcBseZRS((RR(((s*/usr/local/lib/python2.7/test/test_with.pyRus(((RHRtonettwotthree(R RRRR((s*/usr/local/lib/python2.7/test/test_with.pyttestMultipleComplexTargetsjs-&?&!+ (RRRR(((s*/usr/local/lib/python2.7/test/test_with.pyRWs tExitSwallowsExceptionTestCasecBseZdZdZRS(cCsTdddY}y| ddWdQXWntk rO|jdnXdS(NtAfricanSwallowcBseZdZdZRS(cSsdS(N((R ((s*/usr/local/lib/python2.7/test/test_with.pyRscSstS(N(R (R RRR((s*/usr/local/lib/python2.7/test/test_with.pyRs(RRRR(((s*/usr/local/lib/python2.7/test/test_with.pyRs iis,ZeroDivisionError should have been swallowed((RzR(R R((s*/usr/local/lib/python2.7/test/test_with.pyttestExitTrueSwallowsExceptions   cCsTdddY}y| ddWdQXWntk rBnX|jddS(NtEuropeanSwallowcBseZdZdZRS(cSsdS(N((R ((s*/usr/local/lib/python2.7/test/test_with.pyRscSstS(N(R(R RRR((s*/usr/local/lib/python2.7/test/test_with.pyRs(RRRR(((s*/usr/local/lib/python2.7/test/test_with.pyRs iis)ZeroDivisionError should have been raised((RzR(R R((s*/usr/local/lib/python2.7/test/test_with.pyt#testExitFalseDoesntSwallowExceptions  (RRRR(((s*/usr/local/lib/python2.7/test/test_with.pyR}s t NestedWithcBseZdefdYZdefdYZdefdYZdefdYZdZd Zd Z d Z d Z RS( tDummycBs)eZdedZdZdZRS(cCs=|dkr|}n||_||_t|_t|_dS(N(R RtgobbleRRR(R RR((s*/usr/local/lib/python2.7/test/test_with.pyRs      cCst|_|jS(N(R RR(R ((s*/usr/local/lib/python2.7/test/test_with.pyRs cGs#t|_||_|jrtSdS(N(R RR&R(R R&((s*/usr/local/lib/python2.7/test/test_with.pyRs   N(RRR RRRR(((s*/usr/local/lib/python2.7/test/test_with.pyRs t InitRaisescBseZdZRS(cCs tdS(N(R"(R ((s*/usr/local/lib/python2.7/test/test_with.pyRs(RRR(((s*/usr/local/lib/python2.7/test/test_with.pyRst EnterRaisescBseZdZdZRS(cCs tdS(N(R"(R ((s*/usr/local/lib/python2.7/test/test_with.pyRscGsdS(N((R R&((s*/usr/local/lib/python2.7/test/test_with.pyRs(RRRR(((s*/usr/local/lib/python2.7/test/test_with.pyRs t ExitRaisescBseZdZdZRS(cCsdS(N((R ((s*/usr/local/lib/python2.7/test/test_with.pyRscGs tdS(N(R"(R R&((s*/usr/local/lib/python2.7/test/test_with.pyRs(RRRR(((s*/usr/local/lib/python2.7/test/test_with.pyRs c Csn|j<}|j'}|j|j|j|jWdQXWdQX|j|j|j|jdS(N(RRMRR(R RR((s*/usr/local/lib/python2.7/test/test_with.pyttestNoExceptionss c CsZy,|j}|jWdQXWdQXWnnX|j|j|j|jdS(N(RRRMRR(R R((s*/usr/local/lib/python2.7/test/test_with.pyttestExceptionInExprLists c Cs~y9|j'}|j|jdWdQXWdQXWntk rLnX|jd|j|j|j|jdS(Nsbody of bad with executedsRuntimeError not reraised(RRRR"RMRR(R R((s*/usr/local/lib/python2.7/test/test_with.pyttestExceptionInEnters   c Cst}|jdt }|j t}WdQXWdQX|j|j|j|j|j||j|jdddS(NRi( RRR RRMRRtassertNotEqualR&R (R t body_executedR((s*/usr/local/lib/python2.7/test/test_with.pyttestExceptionInExits  c Cs|jddn\}}|jddM\}}|jd||jd||jd||jd|WdQXWdQXdS(NRiii i(ii(i i(RRH(R ta1ta2tb1tb2((s*/usr/local/lib/python2.7/test/test_with.pyttestEnterReturnsTuples ( RRR3RRRRRRRRR(((s*/usr/local/lib/python2.7/test/test_with.pyRs  c Cs#tttttttttdS(N( RR+R]RhRvRRRR(((s*/usr/local/lib/python2.7/test/test_with.pyt test_mains  t__main__(t__doc__t __author__t __email__R%tunittestt collectionsRt contextlibRRttest.test_supportRRRR3RRRR*tTestCaseR+RLR]RhRvRRRRRR(((s*/usr/local/lib/python2.7/test/test_with.pyts4    $O-5 A9&L