usr/lib64/python2.7/unittest/test/test_break.pyo000064400000023637147205025320015572 0ustar00 {fc@sddlZddlZddlZddlZddlZddlmZddlZeje eddej ej dkdej ej dkdd ej fd YZ eje eddej ej dkdej ej dkdd e fd YZeje eddej ej dkdej ej dkdd e fdYZeje eddej ej dkdej ej dkdde fdYZdS(iN(tStringIOtkillsTest requires os.killtwin32sTest cannot run on Windowstfreebsd6s9Test kills regrtest on freebsd6 if threads have been usedt TestBreakcBseZdZdZdZdZdZdZdZ dZ dZ dZ d Z d Zd Zd Zd ZRS(cCsAtjtj|_|jdk r=tjtj|jndS(N(tsignalt getsignaltSIGINTt_default_handlert int_handlertNone(tself((s0/usr/lib64/python2.7/unittest/test/test_break.pytsetUpscCs8tjtj|jtjtj_dtj_ dS(N( RRRtweakreftWeakKeyDictionarytunittesttsignalst_resultsR t_interrupt_handler(R ((s0/usr/lib64/python2.7/unittest/test/test_break.pyttearDownscCstjtj}tj|jtjtj|y#tj}tj|tjWnt k r{|j dnX|j tj j jdS(NsKeyboardInterrupt not handled(RRRRtinstallHandlertassertNotEqualtostgetpidRtKeyboardInterrupttfailt assertTrueRRtcalled(R tdefault_handlertpid((s0/usr/lib64/python2.7/unittest/test/test_break.pyttestInstallHandlers   cCsmtj}tj|xMtjjD]2}||kr<Pq&||k r&|jdq&q&W|jddS(Nsodd object in result setsresult not found(Rt TestResulttregisterResultRRR(R tresulttref((s0/usr/lib64/python2.7/unittest/test/test_break.pyttestRegisterResult,s    cstjtj}tj}tjtj|jtjtj|fd}y||Wntk rj dnXj |j dS(Ncs<tj}tj|tjt|_j|jdS(N( RRRRRtTruet breakCaughtRt shouldStop(R!R(R (s0/usr/lib64/python2.7/unittest/test/test_break.pyttestBs  sKeyboardInterrupt not handled( RRRRRRR RRRRR%(R RR!R'((R s0/usr/lib64/python2.7/unittest/test/test_break.pyttestInterruptCaught9s    cstjtjtjkr+jdntj}tjtj|fd}y||Wnt k r~nXj dj |j dS(Ns&test requires SIGINT to not be ignoredcs\tj}tj|tjt|_j|jtj|tjj ddS(Ns#Second KeyboardInterrupt not raised( RRRRRR$R%RR&R(R!R(R (s0/usr/lib64/python2.7/unittest/test/test_break.pyR'Xs   s#Second KeyboardInterrupt not raised( RRRtSIG_IGNtskipTestRRRR RRRR%(R R!R'((R s0/usr/lib64/python2.7/unittest/test/test_break.pyttestSecondInterruptOs     cCstjtj}tj|tjtj}tj}tj||jtjtj|tj}d}y||Wntk r|j dnX|j |j |j |j |j |j dS(NcSs#tj}tj|tjdS(N(RRRRR(R!R((s0/usr/lib64/python2.7/unittest/test/test_break.pyR'vs sKeyboardInterrupt not handled( RRRR RRRt assertEqualRRRR&t assertFalse(R R!t new_handlertresult2tresult3R'((s0/usr/lib64/python2.7/unittest/test/test_break.pyttestTwoResultsis         cstjtjtjkr+|jdntjtjtjfd}tjtj|y#tj}tj |tjWnt k rnX|j ddS(Ns&test requires SIGINT to not be ignoredcs||dS(N((tframetsignum(thandler(s0/usr/lib64/python2.7/unittest/test/test_break.pyR.ss6replaced but delegated handler doesn't raise interrupt( RRRR)R*RRRRRRR(R R.R((R4s0/usr/lib64/python2.7/unittest/test/test_break.pyttestHandlerReplacedButCalleds   cCsDtjdt}|jtj}|j|tjjdS(Ntstream(RtTextTestRunnerRtrunt TestSuitetassertInRR(R trunnerR!((s0/usr/lib64/python2.7/unittest/test/test_break.pyt testRunnerscCsStj}tj|tj|}~tjtj|j|dS(N(RRR R R"tgctcollectt assertIsNone(R R!R"((s0/usr/lib64/python2.7/unittest/test/test_break.pyttestWeakReferencess   cCstj}tj|tj|jtj||jtjtjy#tj}tj |t j Wnt k rnX|j|j dS(N(RRR RRt removeResultR-RRRRRRR&(R R!R((s0/usr/lib64/python2.7/unittest/test/test_break.pyttestRemoveResults     cstttttjtj}dtffdYdtjffdY}|t}|j|jj didd6d6d6fg|jj g|j|j |jtjtj|g_ g_ |t }|j|jj d idd6d6d6fg|jj g|j|j |jtjtj|dS( Nt FakeRunnercs,eZgZgZdZfdZRS(c_s|jj||fdS(N(tinitArgstappend(R targstkwargs((s0/usr/lib64/python2.7/unittest/test/test_break.pyt__init__scs|jj|S(N(trunArgsRE(R R'(R!(s0/usr/lib64/python2.7/unittest/test/test_break.pyR8s(t__name__t __module__RDRIRHR8((R!(s0/usr/lib64/python2.7/unittest/test/test_break.pyRCs tProgramcs eZfdZRS(csCt|_|_|_||_|_|_d|_dS(N( tFalsetexitt verbositytfailfastt catchbreakR<R'R R!(R RQ(RCRPR'RO(s0/usr/lib64/python2.7/unittest/test/test_break.pyRHs      (RJRKRH((RCRPR'RO(s0/usr/lib64/python2.7/unittest/test/test_break.pyRLstbufferRORP(((tobjectRRRRt TestProgramRMtrunTestsR,RDR RIR!R$R(R RRLtp((RCRPR!R'ROs0/usr/lib64/python2.7/unittest/test/test_break.pyttestMainInstallsHandlers2     (      cCsltjtj}tjtj|jtjtj|tj|jtjtj|dS(N(RRRRRt removeHandlerR,(R R((s0/usr/lib64/python2.7/unittest/test/test_break.pyttestRemoveHandlers    cs^tjtjtjtjfd}|jtjtjdS(Ncs jtjtjdS(N(R,RRR((RR (s0/usr/lib64/python2.7/unittest/test/test_break.pyR's(RRRRRRXR(R R'((RR s0/usr/lib64/python2.7/unittest/test/test_break.pyttestRemoveHandlerAsDecorators  N(RJRKR R R RRR#R(R+R1R5R<R@RBRWRYRZ(((s0/usr/lib64/python2.7/unittest/test/test_break.pyR s         2 tTestBreakDefaultIntHandlercBseZejZRS((RJRKRtdefault_int_handlerR (((s0/usr/lib64/python2.7/unittest/test/test_break.pyR[ stTestBreakSignalIgnoredcBseZejZRS((RJRKRR)R (((s0/usr/lib64/python2.7/unittest/test/test_break.pyR]stTestBreakSignalDefaultcBseZejZRS((RJRKRtSIG_DFLR (((s0/usr/lib64/python2.7/unittest/test/test_break.pyR^s(R=RtsysRR t cStringIORRt skipUnlessthasattrtskipIftplatformtTestCaseRR[R]R^(((s0/usr/lib64/python2.7/unittest/test/test_break.pyts,