ÿØÿàJFIFÿþ ÿÛC       ÿÛC ÿÀÿÄÿÄ"#QrÿÄÿÄ&1!A"2qQaáÿÚ ?Øy,æ/3JæÝ¹È߲؋5êXw²±ÉyˆR”¾I0ó2—PI¾IÌÚiMö¯–þrìN&"KgX:Šíµ•nTJnLK„…@!‰-ý ùúmë;ºgµŒ&ó±hw’¯Õ@”Ü— 9ñ-ë.²1<yà‚¹ïQÐU„ہ?.’¦èûbß±©Ö«Âw*VŒ) `$‰bØÔŸ’ëXÖ-ËTÜíGÚ3ð«g Ÿ§¯—Jx„–’U/ÂÅv_s(Hÿ@TñJÑãõçn­‚!ÈgfbÓc­:él[ðQe 9ÀPLbÃãCµm[5¿ç'ªjglå‡Ûí_§Úõl-;"PkÞÞÁQâ¼_Ñ^¢SŸx?"¸¦ùY騐ÒOÈ q’`~~ÚtËU¹CڒêV  I1Áß_ÿÙ 41{Sc@sdZddlmZddlZddlZddlZddlmZddlm Z ddl m Z ddl m Z mZmZejdkrejd d d fkrddlZejd dd lmZnd efdYZnejeZeZdZdefdYZdejfdYZdefdYZ defdYZ!defdYZ"dejfdYZ#dfdYZ$dfdYZ%dS( s Test Suites ----------- Provides a LazySuite, which is a suite whose test list is a generator function, and ContextSuite,which can run fixtures (setup/teardown functions or methods) for the context that contains its tests. i(t generatorsN(tTest(tConfig(tResultProxyFactory(tisclasst resolve_namettry_runtcliiit IronPython(tStringExceptionR cBseZRS((t__name__t __module__(((s;/opt/alt/python27/lib/python2.7/site-packages/nose/suite.pyR scCsd|j|jfS(Ns%s.%s(R R (tcls((s;/opt/alt/python27/lib/python2.7/site-packages/nose/suite.pyt _strclass$stMixedContextErrorcBseZdZRS(sQError raised when a context suite sees tests from more than one context. (R R t__doc__(((s;/opt/alt/python27/lib/python2.7/site-packages/nose/suite.pyR'st LazySuitecBs}eZdZd dZdZdZdZeZdZdZ dZ dZ d Z e e e d d ZRS( s:A suite that may use a generator as its list of tests cCs$tt|j|j|dS(sFInitialize the suite. tests may be an iterable or a generator N(tsuperRt__init__t _set_tests(tselfttests((s;/opt/alt/python27/lib/python2.7/site-packages/nose/suite.pyR1scCs t|jS(N(titert_tests(R((s;/opt/alt/python27/lib/python2.7/site-packages/nose/suite.pyt__iter__7scCsdt|jt|fS(Ns<%s tests=generator (%s)>(R t __class__tid(R((s;/opt/alt/python27/lib/python2.7/site-packages/nose/suite.pyt__repr__:scCs tj|S(N(tobjectt__hash__(R((s;/opt/alt/python27/lib/python2.7/site-packages/nose/suite.pyR>scCs|jj|dS(N(t _precachetappend(Rttest((s;/opt/alt/python27/lib/python2.7/site-packages/nose/suite.pytaddTestCscCs/x(|jD]}|jrPn||q W|S(N(Rt shouldStop(RtresultR ((s;/opt/alt/python27/lib/python2.7/site-packages/nose/suite.pytrunGs  cCstjdt||jr#tS|jdkr6tSy3|jj}|dk rh|jj |tSWnt k r|nXtS(Ns tests in %s?( tlogtdebugRRtTruettest_generatortNonetFalsetnextRt StopIteration(RR ((s;/opt/alt/python27/lib/python2.7/site-packages/nose/suite.pyt __nonzero__Ns   ccs\tjd|jx|jD] }|VqW|jdkr?dSx|jD] }|VqIWdS(Nsprecache is %s(R%R&RR(R)(RR ((s;/opt/alt/python27/lib/python2.7/site-packages/nose/suite.pyt _get_tests]s cCsyg|_t|tj}t|r=| r=||_n8|r_|j|gd|_n|j|d|_dS(N(Rt isinstancetunittestt TestSuitetcallableR(taddTestsR)(RRtis_suite((s;/opt/alt/python27/lib/python2.7/site-packages/nose/suite.pyRfs   sbAccess the tests in this suite. Access is through a generator, so iteration may not be repeatable.(N(R R RRRRRt__str__R!R$R-R.RtpropertyR)R(((s;/opt/alt/python27/lib/python2.7/site-packages/nose/suite.pyR.s         t ContextSuitecBs eZdZejjZeZeZd.Z d/Z d0Z d1Z d2Z d3Zd4d5d5d5d5edZdZeZdZd Zd!Zd"Zd#Zd$Zd5d%Zd&Zd'Zd(Zd)Zd*Zd+Z d,Z!e"e!e#j$d5d-Z%RS(6s4A suite with context. A ContextSuite executes fixtures (setup and teardown functions or methods) for the context containing its tests. The context may be explicitly passed. If it is not, a context (or nested set of contexts) will be constructed by examining the tests in the suite. t setup_classt setup_allt setupClasstsetupAllt setUpClasstsetUpAlltteardown_classt teardown_allt teardownClasst teardownAllt tearDownClasst tearDownAllt setup_modulet setupModulet setUpModuletsetuptsetUptteardown_moduletteardownModulettearDownModuletteardownttearDownt setup_packaget setupPackaget setUpPackagetteardown_packagetteardownPackagettearDownPackagecCstjd||t|||_||_|dkrFt}n||_||_t |_ ||_ d|_ t t|j|dS(NsContext suite for %s (%s) (%s)(R%R&RtcontexttfactoryR)Rtconfigt resultProxyR*thas_runt can_splitt error_contextRR7R(RRRTRURVRWRY((s;/opt/alt/python27/lib/python2.7/site-packages/nose/suite.pyRs         cCs)dt|jt|jd|jfS(Ns<%s context=%s>R (R RtgetattrRT(R((s;/opt/alt/python27/lib/python2.7/site-packages/nose/suite.pyRs cCs.|jr dt||jfSt|SdS(Ns%s:%s(RZtrepr(R((s;/opt/alt/python27/lib/python2.7/site-packages/nose/suite.pyRs cCs tj|S(N(RR(R((s;/opt/alt/python27/lib/python2.7/site-packages/nose/suite.pyRscOs|j||S(N(R$(Rtargtkw((s;/opt/alt/python27/lib/python2.7/site-packages/nose/suite.pyt__call__scCs tjS(s.Hook for replacing error tuple output (tsystexc_info(R((s;/opt/alt/python27/lib/python2.7/site-packages/nose/suite.pyRascCsY|j}tjdkrUt|dtrUt|d|d|df}qUn|S(s:Bottleneck to fix up IronPython string exceptions Riii(RaR`tplatformR/R tstr(Rte((s;/opt/alt/python27/lib/python2.7/site-packages/nose/suite.pyt _exc_infos  'cCs3tjdt|||j|jrD|j|||}}n ||}}y|jWn:tk run'd|_|j||j dSXz<x5|jD]*}|j rtjdPn||qWWdt |_ y|j Wn9tk rn&d|_|j||j nXXdS(s5Run tests in suite inside of suite fixtures. s#suite %s (%s) run called, tests: %sRGNtstoppingRL(R%R&RRRWRHtKeyboardInterruptRZtaddErrorReR"R'RXRM(RR#torigR ((s;/opt/alt/python27/lib/python2.7/site-packages/nose/suite.pyR$s4         cCs|j}|dkrtS|j|d|r2tS|j}|r|jj|g}x*|D]}|j|d|r]tSq]WntS(Nt ctx_callback(RTR)R*timplementsAnyFixtureR'RUtget(RRjRTRUt ancestorstancestor((s;/opt/alt/python27/lib/python2.7/site-packages/nose/suite.pyt hasFixturess     cCst|r|j|j}n6|j|j}t|drU||j|j7}nt}x'|D]}t||rbt }PqbqbW|dkr|S|||S(Nt__path__( Rt classSetupt classTeardownt moduleSetuptmoduleTeardownthasattrt packageSetuptpackageTeardownR*R'R)(RRTRjtnamestfixttm((s;/opt/alt/python27/lib/python2.7/site-packages/nose/suite.pyRks   cCsAtjdt||j|s<tjdt|dS|jr_tjdt|dS|j}|dkrxdS|j}|r|jj|g}xX|r|j }tjd|||jkrqntjd||j |qW||jkr'|j |q'n |j |t |_tjddS(Ns suite %s setUp called, tests: %sssuite %s has no testsssuite %s already set upsancestor %s may need setupsancestor %s does need setupscompleted suite setup( R%R&RRt was_setupRTR)RURltpopt setupContextR'(RRTRURmRn((s;/opt/alt/python27/lib/python2.7/site-packages/nose/suite.pyRH s2        cCs|jjj|tjd|||jrX||jjkrEdS||jj|R?R@RARBRC(RDRERFRGRH(RIRJRKRLRM(RNRORP(RQRRRS(N(&R R RR0tTestCasetfailureExceptionR*R{RRqRrRsRtRvRwR)R'RRR5RRR_RaReR$RoRkRHR}RRMRRR6RRR(((s;/opt/alt/python27/lib/python2.7/site-packages/nose/suite.pyR7ysF         &     !  tContextSuiteFactorycBs\eZdZeZddedZdZdZ dZ dZ dZ dZ RS( sCFactory for ContextSuites. Called with a collection of tests, the factory decides on a hierarchy of contexts by introspecting the collection or the tests themselves to find the objects containing the test objects. It always returns one suite, but that suite may consist of a hierarchy of nested suites. cCs|dkrt}n||_|dk r9||_n|tkrWtd|}n||_i|_i|_i|_ i|_ dS(NRV( R)RRVt suiteClasst_defRRWtsuitesRTR{R(RRVRRW((s;/opt/alt/python27/lib/python2.7/site-packages/nose/suite.pyRs          cKstjd||jdt|dd}tjd|||dkr|j|}y|j|}Wqtk r|j|j |d|SXn|j|||S(sReturn ``ContextSuite`` for tests. ``tests`` may either be a callable (in which case the resulting ContextSuite will have no parent context and be evaluated lazily) or an iterable. In that case the tests will wrapped in nose.case.Test, be examined and the context of each found and a suite of suites returned, organized into a stack with the outermost suites belonging to the outermost contexts. sCreate suite for %sRTstests %s context %sN( R%R&R|R[R)t wrapTestst findContextRt makeSuitet mixedSuites(RRR^RT((s;/opt/alt/python27/lib/python2.7/site-packages/nose/suite.pyR_s    ccstjd||dkr dSt|dr;|j}nt|drY|jj}nt|dr}|jjd}n8t|dr|j jdd }nt d |x;|rtjd ||t dj |V|j qWdS( sReturn the ancestry of the context (that is, all of the packages and modules containing the context), in order of descent with the outermost ancestor last. This method is a generator. sget ancestry %sNtim_classt__self__R t.R is%s has no ancestors?s %s ancestors %s(R%R&R)RuRRRR tsplitR t TypeErrorRtjoinR|(RRTRm((s;/opt/alt/python27/lib/python2.7/site-packages/nose/suite.pytancestrys    cCst|st|tjr"dSd}xl|D]d}t|dd}|dkrYq/n|dkrn|}q/||kr/td||fq/q/W|S(NRTs5Tests with different contexts in same suite! %s != %s(R2R/R0R1R)R[R(RRRTR tctx((s;/opt/alt/python27/lib/python2.7/site-packages/nose/suite.pyRs     c Ks|j|d|d|jd|d|j|}|dk r|jj|gj||jj|gj|tj d|t |ddx`|j |D]L}|jj|gj||j|j|tj d||j qWn|S(NRTRVRURWssuite %s has context %sR ssuite %s has ancestor %s( RRVRWR)Rt setdefaultRRTR%R&R[RR (RRRTR^tsuiteRn((s;/opt/alt/python27/lib/python2.7/site-packages/nose/suite.pyRs  cCs|s gS|jd}|s&|gS|}|}t|dd}|dk r|gg|j|D] }|^qg}x|D]}|g} g} x|D]} t} t| dd} | dkr| j| qn| |kr| j| qnx:|j| D])}||kr | j| t} Pq q W| s| j| qqW| rk|j| |}n|j| }qWn|g|S(scThe complex case where there are tests that don't all share the same context. Groups tests into suites with common ancestors, according to the following (essentially tail-recursive) procedure: Starting with the context of the first test, if it is not None, look for tests in the remaining tests that share that ancestor. If any are found, group into a suite with that ancestor as the context, and replace the current suite with that suite. Continue this process for each ancestor of the first test, until all ancestors have been processed. At this point if any tests remain, recurse with those tests as the input, returning a list of the common suite (which may be the suite or test we started with, if no common tests were found) plus the results of recursion. iRTN( R|R[R)RR*RR'RR(RRtheadRttailRTtaRmRntcommontremainR t found_commonttest_ctxt test_ancestor((s;/opt/alt/python27/lib/python2.7/site-packages/nose/suite.pyRsB )         cCstjd|t|s.t|tjr?tjd|Sg}x|D]}tjd|t|tst|tjr|j|qLt|tr|j|j |d|j qL|jt|d|j d|j qLW|S(Nswrap %ss I won't wraps wrapping %sRTRVRW( R%R&R2R/R0R1RRt ContextListRRTRVRW(RRtwrappedR ((s;/opt/alt/python27/lib/python2.7/site-packages/nose/suite.pyRs  !"#N(R R RR7RR)RRR_RRRRR(((s;/opt/alt/python27/lib/python2.7/site-packages/nose/suite.pyRs     2RcBs#eZdZddZdZRS(sNot quite a suite -- a group of tests in a context. This is used to hint the ContextSuiteFactory about what context the tests belong to, in cases where it may be ambiguous or missing. cCs||_||_dS(N(RRT(RRRT((s;/opt/alt/python27/lib/python2.7/site-packages/nose/suite.pyR2s cCs t|jS(N(RR(R((s;/opt/alt/python27/lib/python2.7/site-packages/nose/suite.pyR6sN(R R RR)RR(((s;/opt/alt/python27/lib/python2.7/site-packages/nose/suite.pyR-s tFinalizingSuiteWrappercBs2eZdZdZdZdZdZRS(sWraps suite and calls final function after suite has executed. Used to call final functions in cases (like running in the standard test runner) where test running is not under nose's control. cCs)tt|j||_||_dS(N(RRRRtfinalize(RRR((s;/opt/alt/python27/lib/python2.7/site-packages/nose/suite.pyR@s cOs|j||S(N(R$(RR]R^((s;/opt/alt/python27/lib/python2.7/site-packages/nose/suite.pyR_EscCs t|jS(N(RR(R((s;/opt/alt/python27/lib/python2.7/site-packages/nose/suite.pyRIscOs,z|j||SWd|j||XdS(N(RR(RR]R^((s;/opt/alt/python27/lib/python2.7/site-packages/nose/suite.pyR$Ls(R R RRR_RR$(((s;/opt/alt/python27/lib/python2.7/site-packages/nose/suite.pyR:s    tTestDircBseZdZRS(cOstddS(NsTestDir is not usable with nose 0.10. The class is present in nose.suite for backwards compatibility purposes but it may not be used.(tNotImplementedError(R]R^((s;/opt/alt/python27/lib/python2.7/site-packages/nose/suite.pyRUs(R R R(((s;/opt/alt/python27/lib/python2.7/site-packages/nose/suite.pyRTst TestModulecBseZdZRS(cOstddS(NsTestModule is not usable with nose 0.10. The class is present in nose.suite for backwards compatibility purposes but it may not be used.(R(R]R^((s;/opt/alt/python27/lib/python2.7/site-packages/nose/suite.pyR]s(R R R(((s;/opt/alt/python27/lib/python2.7/site-packages/nose/suite.pyR\s(&Rt __future__RtloggingR`R0t nose.caseRt nose.configRt nose.proxyRt nose.utilRRRRbt version_infotclrt AddReferencetIronPython.Runtime.ExceptionsR t Exceptiont getLoggerR R%RRR RR1RR7RRRRR(((s;/opt/alt/python27/lib/python2.7/site-packages/nose/suite.pyt s4       K