ÿØÿà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Áß_ÿÙ SSc@s;dZddlZddlZddlZddlZddlZddlZddlZddlmZddl m Z ddl m Z ddl m Z ddlmZddlmZmZejd Zejd Zd Zd Zd ZdZdZdefdYZde fdYZdS(sThis plugin provides test results in the standard XUnit XML format. It's designed for the `Jenkins`_ (previously Hudson) continuous build system, but will probably work for anything else that understands an XUnit-formatted XML representation of test results. Add this shell command to your builder :: nosetests --with-xunit And by default a file named nosetests.xml will be written to the working directory. In a Jenkins builder, tick the box named "Publish JUnit test result report" under the Post-build Actions and enter this value for Test report XMLs:: **/nosetests.xml If you need to change the name or location of the file, you can set the ``--xunit-file`` option. Here is an abbreviated version of what an XML test report might look like:: Traceback (most recent call last): ... TypeError: oops, wrong type .. _Jenkins: http://jenkins-ci.org/ iN(tStringIO(ttime(tsaxutils(tPlugin(tSkipTest(t force_unicodetformat_exceptions[\000-\010\013\014\016-\037]s^(.*?)(\(.*\))$cCstjd|S(s)Replaces invalid XML characters with '?'.t?(tCONTROL_CHARACTERStsub(tvalue((sC/opt/alt/python27/lib/python2.7/site-packages/nose/plugins/xunit.pytxml_safe;scCst|jddS(s)Escape a string for an XML CDATA section.s]]>s]]>]]>>> nice_classname(Exception()) # doctest: +ELLIPSIS '...Exception' >>> nice_classname(Exception) # doctest: +ELLIPSIS '...Exception' sorg.python.core.s%s.%sN(tinspecttisclasst__name__t __class__t getmodulet startswithtlen(tobjtcls_nametmodR((sC/opt/alt/python27/lib/python2.7/site-packages/nose/plugins/xunit.pytnice_classnameLs    cCs|d}|dkr#|d}nUyt|}WnBtk rwyt|}Wqxtk rs|jd}qxXnXt|d}t|S(sReturn the exception's message.iisUTF-8N(tNonetstrtUnicodeEncodeErrortunicodet UnicodeErrortargsRR (texc_infotexctresult((sC/opt/alt/python27/lib/python2.7/site-packages/nose/plugins/xunit.pyt exc_messagecs     tTeecBs5eZdZdZdZdZdZRS(cGs||_||_dS(N(t _encodingt_streams(tselftencodingR+((sC/opt/alt/python27/lib/python2.7/site-packages/nose/plugins/xunit.pyt__init__ws cCs7t||j}x|jD]}|j|qWdS(N(RR1R2twrite(R3tdatats((sC/opt/alt/python27/lib/python2.7/site-packages/nose/plugins/xunit.pyR6{scCs"x|D]}|j|qWdS(N(R6(R3tlinestline((sC/opt/alt/python27/lib/python2.7/site-packages/nose/plugins/xunit.pyt writeliness cCs"x|jD]}|jq WdS(N(R2tflush(R3R8((sC/opt/alt/python27/lib/python2.7/site-packages/nose/plugins/xunit.pyR<scCstS(N(tFalse(R3((sC/opt/alt/python27/lib/python2.7/site-packages/nose/plugins/xunit.pytisattys(Rt __module__R5R6R;R<R>(((sC/opt/alt/python27/lib/python2.7/site-packages/nose/plugins/xunit.pyR0vs     tXunitcBseZdZdZdZdZdZdZdZ dZ dZ dZ d Z d Zd Zd Zd ZdZdZdZdZdZddZdddZddZRS(sCThis plugin provides test results in the standard XUnit XML format.txunitisUTF-8cCs2tt|jg|_d|_d|_dS(N(tsuperR@R5t_capture_stackR&t_currentStdoutt_currentStderr(R3((sC/opt/alt/python27/lib/python2.7/site-packages/nose/plugins/xunit.pyR5s  cCs,t|dr"t|j}nd}|S(Nt_timerg(thasattrRRF(R3ttaken((sC/opt/alt/python27/lib/python2.7/site-packages/nose/plugins/xunit.pyt _timeTakenscCst|}tj|S(s.Escape an XML attribute. Value can be unicode.(R Rt quoteattr(R3tattr((sC/opt/alt/python27/lib/python2.7/site-packages/nose/plugins/xunit.pyt _quoteattrs c CsNtj||||jdddddddd|jd d d d d S(s%Sets additional command line options.s --xunit-filetactiontstoretdestt xunit_filetmetavartFILEtdefaulttNOSE_XUNIT_FILEs nosetests.xmlthelpsrPath to xml file to store the xunit report in. Default is nosetests.xml in the working directory [NOSE_XUNIT_FILE]N(Rtoptionst add_optiontget(R3tparsertenv((sC/opt/alt/python27/lib/python2.7/site-packages/nose/plugins/xunit.pyRVs   cCsrtj|||||_|jrnidd6dd6dd6dd6|_g|_tjj|j |_ ndS(sConfigures the xunit plugin.iterrorstfailurestpassestskippedN( Rt configuretconfigtenabledtstatst errorlisttostpathtrealpathRPterror_report_file_name(R3RVR`((sC/opt/alt/python27/lib/python2.7/site-packages/nose/plugins/xunit.pyR_s     cCstj|jd|jd|_|j|jd<|jd|jd|jd|jd|jd<|jjd |j|jjd jg|jD]}t ||j^q|jjd |jj |j j d kr|j d d|j d|jjndS(smWrites an Xunit-formatted XML file The file includes a report of test errors and failures. twR R4R[R\R]R^ttotaluuu it-iFsXML: %sN(tcodecstopenRgR4terror_report_fileRbR6tjoinRcRtcloseR`t verbositytwritelnR(R3tstreamte((sC/opt/alt/python27/lib/python2.7/site-packages/nose/plugins/xunit.pytreports5  ) cCst|jjtjtjft|_t|_t|j |jtjt_t|j |jtjt_dS(N( RCtappendtsyststdouttstderrRRDRER0R4(R3((sC/opt/alt/python27/lib/python2.7/site-packages/nose/plugins/xunit.pyt _startCaptures   cCs|jdS(N(Ry(R3tcontext((sC/opt/alt/python27/lib/python2.7/site-packages/nose/plugins/xunit.pyt startContextscCs|jdS(N(t _endCapture(R3Rz((sC/opt/alt/python27/lib/python2.7/site-packages/nose/plugins/xunit.pyt stopContextscCst|_|jdS(s+Initializes a timer before starting a test.N(RRFRy(R3ttest((sC/opt/alt/python27/lib/python2.7/site-packages/nose/plugins/xunit.pyt beforeTests cCs+|jr'|jj\t_t_ndS(N(RCtpopRvRwRx(R3((sC/opt/alt/python27/lib/python2.7/site-packages/nose/plugins/xunit.pyR|s cCs |jd|_d|_dS(N(R|R&RDRE(R3R~((sC/opt/alt/python27/lib/python2.7/site-packages/nose/plugins/xunit.pyt afterTests  cCsx|jr|jqWdS(N(RCR|(R3R~((sC/opt/alt/python27/lib/python2.7/site-packages/nose/plugins/xunit.pytfinalizes cCs3|jr/|jj}|r/dt|SndS(Ns't(RDtgetvalueR(R3R ((sC/opt/alt/python27/lib/python2.7/site-packages/nose/plugins/xunit.pyt_getCapturedStdouts   cCs3|jr/|jj}|r/dt|SndS(Ns'R(RERR(R3R ((sC/opt/alt/python27/lib/python2.7/site-packages/nose/plugins/xunit.pyt_getCapturedStderrs   cCs#|j}t|dtr;d}|jdcd7<%(type)s type=%(errtype)s message=%(message)s>%(systemout)s%(systemerr)stclsiRRHttypeterrtypetmessagettbt systemoutt systemerrN(RIt issubclassRRbRR4tidRcRuRLRR%R/RRR(R3R~terrtcaptRHRRR((sC/opt/alt/python27/lib/python2.7/site-packages/nose/plugins/xunit.pytaddErrors&     cCs|j}t||j}|jdcd7<|j}|jjdi|jt|dd6|jt|dd6|d6|jt |dd 6|jt |d 6t |d 6|j d 6|j d 6dS(s,Add failure output to Xunit report. R\iu%(systemout)s%(systemerr)siRiRRHRRRRRN(RIRR4RbRRcRuRLRR%R/RRR(R3R~RRttb_infoRHRR((sC/opt/alt/python27/lib/python2.7/site-packages/nose/plugins/xunit.pyt addFailure%s     cCs|j}|jdcd7<|j}|jjdi|jt|dd6|jt|dd6|d6|jd 6|jd 6d S( s,Add success output to Xunit report. R]isb%(systemout)s%(systemerr)siRiRRHRRN( RIRbRRcRuRLRRR(R3R~RRHR((sC/opt/alt/python27/lib/python2.7/site-packages/nose/plugins/xunit.pyt addSuccess;s    N(RR?t__doc__RtscoreR4R&RmR5RIRLRVR_RtRyR{R}RR|RRRRRRR(((sC/opt/alt/python27/lib/python2.7/site-packages/nose/plugins/xunit.pyR@s.             (RRktdoctestRdRvt tracebacktreRRRtxml.saxRtnose.plugins.baseRtnose.excRtnose.pyversionRRtcompileRRR RRR%R/tobjectR0R@(((sC/opt/alt/python27/lib/python2.7/site-packages/nose/plugins/xunit.pyt&s,