fWG`c@sdZddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlZddlZddlZddlZddlZx~e jjD]mZeedr1gejD]Zejje^q e_needr[ejjeje_nqWe jdkryddlZWnek rnNXejej\ZZ e!e e"eddZ#ej$eje#e fne jdkryddl%Z%Wne&k rnXnd Z'd Z(dZ)d Z*d Z+d Z,dZ-dZ.dZ/dZ0ddl1m2Z2dddddddddddf Z3e3dfZ4ejjej5a6ddZ7d Z8id!e'6d"e(6d#e)6d$e*6d%e+6d&e,6d'e-6d(e.6Z9d)Z:d*Z;d+Z<e=e=d e>e>e>e>e=e>e=e>d,e>e>e>e>e=e=e>e>e>e>e>e=d-Z?d.d/d0d1d2d3d4d5d6g Z@d7d8d9hZAe=e@eAd:ZBe>e=e>e>e=e=d;ZCd<fd=YZDd>ZEe>e>e=d?ZFd@ZGdAZHdBZIdCZJdDZKe=dEZLdFZMdGZNdHdIe=dJZOdKZPdLZQdMZRidNd6dOdP6dQdR6dQdS6dTdU6dVdW6dXd6dYdZ6d[d\6d]d^6d_d`6dadb6dcdd6dedf6dgdh6didj6ZSeSddeSdk2GB of disk space temporarily. network - It is okay to run tests that use external network resource, e.g. testing SSL support for sockets. bsddb - It is okay to run the bsddb testsuite, which takes a long time to complete. decimal - Test the decimal module against a large suite that verifies compliance with standards. cpu - Used for certain CPU-heavy tests. subprocess Run all tests for the subprocess module. urlfetch - It is okay to download files required on testing. gui - Run tests that require a running GUI. xpickle - Test pickle and cPickle against Python 2.4, 2.5 and 2.6 to test backwards compatibility. These tests take a long time to run. To enable all resources except one, use '-uall,-'. For example, to run all the tests except for the bsddb tests, give the option '-uall,-bsddb'. --matchfile filters tests using a text file, one pattern per line. Pattern examples: - test method: test_stat_attributes - test class: FileTests - test identifier: test_os.FileTests.test_stat_attributes iNt__path__t__file__tdarwiniitwin32iiiiiiig>@(tsupporttaudiotcursest largefiletnetworktbsddbtdecimaltcput subprocessturlfetchtguitxpickletextralargefiletcCs$tGH|r|GHntj|dS(N(t__doc__tsystexit(tcodetmsg((s#/usr/lib/python2.7/test/regrtest.pytusage scCsttj|d}t|d\}}t|d\}}t|d\}}g}|rx|jd|n|r|jd|n|r|jd|n|r|jd|n|sdS|d }d j|S( Ng@@ii<s%s hours%s mins%s secs%s mss0 msit (tinttmathtceiltdivmodtappendtjoin(tsecondstmstminutesthourstparts((s#/usr/lib/python2.7/test/regrtest.pytformat_durations" s %s passeds %s faileds%s failed (env changed)s %s skippeds%s skipped (resource denied)s%s interrupteds %s crasheds%s run no testscCstj|d}||S(Ns%s(t_FORMAT_TEST_RESULTtget(t test_nametresulttfmt((s#/usr/lib/python2.7/test/regrtest.pytformat_test_result4scCs]ytjdSWnttfk r*nXyddl}Wntk rNn X|jSdS(NtSC_NPROCESSORS_ONLNi(tostsysconftAttributeErrort ValueErrortmultiprocessingt ImportErrort cpu_counttNone(R0((s#/usr/lib/python2.7/test/regrtest.pyR29s  cCsIxBtjjD]1}||kr|jdrtj|qqWdS(Nstest.(Rtmodulestkeyst startswithRtunload(t save_modulestmodule((s#/usr/lib/python2.7/test/regrtest.pytunload_test_modulesKstcoveragec[&stjtjtjytjtjddddddddd d d d d ddddddddddddddddddd d!d"d#d$d%g#\}}Wn#tjk r}td&|nX|dDkrt j d'}n dDkrg ndD}t }t }t t }xD|D]<\}} |dkrNtd*q)|dkrg!d7!q)|dkr|t }q)|dkrt }q)|dkrt q)|dkrt d*!q)|dkrt }q)|dkrt }q)|dkrt q)|dkrt }q)|d>kr0t| }q)|dkrE| }q)|dkrvdDkrfgnj| q)|dCkrdDkrgntjjtj| }!t|!+}"x!|"D]}#j|#jqWWdDQXq)|dkrt }q)|dkrt } q)|dkrCdKdDl}$|$jt| q)|dkrXt } q)|dkrtjjtj| } q)|dkrdD} q)|dkrc| jdT t dkr| G GHtd&dVn d*sdW d*j?}7|r x7|D]/}8|8|6kr |6j|8n|7j@|8q Wg}n r dGH|7j@dn!s |s p |p p | o  }9tA|6|7}:p( |p( |:|rw d y|:|:jBd*d};Wqw tCk rs dD};qw Xn|r xD] }/|/GHq Wtj"d*n|r tDtj"d*n| r dKdDlE} | jFdt dt }<ng t_GtHtjI}= fd|rq tJfd}>|>dtdUn1tKdj!ttdfd}?|9r8 dGtLjMGdjtjNjGHdGtLjLdt GdtjOGHdGtjGHtP}@|@r8 dG|@GHq8 n rd \}+},}-|+dUkrd dGHqd n|r t jQ|dG|GHt jRn|r5ydKdlSmT}AWn#t6k r dGHtj"d&nXdKdlUmU}BmV}CdKdlWmXmYtZj[d|B  !fd}D|Dtj\}Etj]g|EdAdgr}dignd|AffdY}Fgt^|D]}G|F^q}Hdt|HGHx|HD]}I|Ij_qWd}Jd*}Kd}Lt`tatb}Myx|K|kryjcd|M}NWnO|Ck r|J|H}O|Or! r!ddj|OGHtjjdq!q!nX|N\}P}Q}1dDkr|Kd7}Kq!n|1sp|1\}R}Ste|R}T|Rtft2fkr-|Stbkr- r-|Tdtg|S7}Tn|J|H}O|Or` r`|Tddj|O7}Tn|?|L|Tn|Pr~|PGHntjjd|Qr rtj |QIJntj jd|1d*t2kr|1ddksthtin|Ld7}Lq!WWn!tik rt j8nXx|HD]}I|IjqWndGHdD}UxtjdD]\}Ls}T|Urd|T|Uf}Tn|?|L|Tn !f d}Vtj}W| rtktl}X|<jmddtnd|X|Xd}1n{yW|V}1|rX|1d*tokrXs6dGHnt0t  dDdznWn!tik rst Pn nXtj|W}Ste|1d*}U|Stbkrd|Utg|Sf}Un|1d*tpkrdD}Un|r*|$jq|$jrr*dGt|$jrGdGH|3j;|$jr|$jr2q*nts|=qPW fd  fd}Y|Y|rr HdGHxD]dGHtjjdy4t t_tt0t  dDddz}RWntik r$HPqX|Rd*tptutvtwhkrjqqWrtxtdGdGHtyn|Yn|r|;rt|!d}"|"jz|;dWdDQXqtj-|!n| r|<j{}'|'j|dt dt d| n| r#tj}dtj~nHtj}Zdtg|ZGHd GHretj"d&n r{tj"dnrrtj"dUntj"d*dDS(slExecute a test suite. This also parses command-line options and modifies its behavior accordingly. tests -- a list of strings containing test names (optional) testdir -- the directory in which to look for tests (optional) Users other than the Python test suite will certainly want to specify testdir; if it's omitted, the directory containing the Python test suite is searched for. If the tests argument is omitted, the tests listed on the command-line will be used. If that's empty, too, then all *.py files beginning with test_ will be used. The other default arguments (verbose, quiet, exclude, single, randomize, findleaks, use_resources, trace, coverdir, print_slow, and random_seed) allow programmers calling main() directly to set the values that would normally be set by flags on the command line. is hvqxsSrf:lu:t:TD:NLR:FwWM:j:PGm:thelptverbosetverbose2tverbose3tquiettexcludetsingletslowtslowestt randomizes fromfile=t findleakssuse=s threshold=ttraces coverdir=t nocoverdirtrunleakss huntrleaks=s memlimit=s randseed=s multiprocess=s slaveargs=tforevertheadertpgotfailfastsmatch=stestdir=s list-testss list-casesR;s matchfile=sfail-env-changedtcleanupiis-hs--helpis-vs --verboses-ws --verbose2s-Ws --verbose3s-Gs --failfasts-qs--quiets-xs --excludes-ss--singles-Ss--slows --slowests-rs --randomizes --randseeds-fs --fromfiles-ms--matchs --matchfileNs-ls --findleakss-Ls --runleakss-ts --thresholdis-Ts --coverages-Ds --coverdirs-Ns --nocoverdirs-Rs --huntrleakst:is)-R takes 2 or 3 colon-separated argumentsiis reflog.txts-Ms --memlimits-us--uset,tallt-sInvalid -u/--use option: s-Fs --forevers-js--multiprocesss--headers --slaveargss-Ps--pgos --testdirs --list-testss --list-casess--fail-env-changeds --cleanupsQNo handler for option {}. Please report this as a bug at http://bugs.python.org.s-s and -f don't go together!s-T and -j don't go together!s-l and -j don't go together!s#-G/--failfast needs either -v or -WRswInvalid values for the --huntrleaks/-R parameters. The number of warmups and repetitions must be at least 1 each (1:1).s test_python_*sCleanup %s directorysRemove directory: %ssRemove file: %sttestdirs%No GC available, disabling findleaks.t pynexttesttrt#sEWarning: bpo-31731: test_io hangs with --huntrleaks: exclude the testttest_iotcountcs|\}}|ttfkr4j||fn|tkrPj|n|ttfkrrj|n|tkrj|n|tkrj|nd|tkrj|j|n;|tkrj|n|tkrt d|ndS(Nsinvalid test result: %r( t CHILD_ERRORt INTERRUPTEDRtPASSEDtFAILEDt ENV_CHANGEDtSKIPPEDtRESOURCE_DENIEDtTEST_DID_NOT_RUNR/(ttestR(tokt test_time(tbadtenvironment_changedtgoodtresource_deniedst run_no_teststskippedt test_times(s#/usr/lib/python2.7/test/regrtest.pytaccumulate_results$        c3sAx:tr<x-|D]%}|Vr%dSrrdSqWqWdS(N(tTrue(ttestsRa(RdRetfail_env_changed(s#/usr/lib/python2.7/test/regrtest.pyt test_forevers   s/{}csdj|}tt}|rM rMdj||}ndj|}ttdrtjd}dj||}ntj}tjdt|}d||f}d j||}|GHt j j dS( Ns {1:{0}}{2}s{}/{}s[{}]t getloadavgisload avg: {:.2f} {}Rs%s %ss{} {}( tformattlenthasattrR,Rpttimetdatetimet timedeltaRRtstdouttflush(t test_indexRatlinetfailst load_avg_1minRc(RdReRLtregrtest_start_timet test_countttest_count_width(s#/usr/lib/python2.7/test/regrtest.pytdisplay_progresss s==Rs== taliaseds %s-endians == CPU count:shWARNING: Running tests with --huntrleaks/-R and less than 3 warmup repetitions can give false positives!sUsing random seed(tThreads+Multiprocess option requires thread support(tQueuetEmpty(tPopentPIPEs \[\d+ refs\]$c 3sVxOD]G}|ftdddddf}||fVqWdS(Nt huntrleakst use_resourcesRMt match_testsRL(tdict(Rat args_tuple(RMRRRLR@RmRR=(s#/usr/lib/python2.7/test/regrtest.pyttests_and_argss   s test.regrtesttMultiprocessThreadcsDeZdZdZfdZfdZRS(c syt\}}Wntk r7jd tSXdtj|g}rm|jdfnzgtj|_ ||_ |dddtdt j dk}|j \}}|j}Wdd|_ Xjd|}|d krF|jjd \}}} | s4jd tStj| } ntd |f} j||j|j| ftS(Ns --slaveargss --testdirRwtstderrtuniversal_newlinest close_fdstntRis s Exit code %s(NNNN(NNNN(tnextt StopIterationtputR3RltjsontdumpstextendRtt start_timet current_testR,tnamet communicatetwaittsubtstript rpartitiontloadsRYtrstriptFalse( tselfRaRtargstpopenRwRtretcodet_R((RRtbase_cmdtdebug_output_pattoutputtpendingRS(s#/usr/lib/python2.7/test/regrtest.pytruntests8        %csKy#t}x|s!|j}q WWn!tk rFjdnXdS(N(NNNN(RRt BaseExceptionRR3(Rtstop(R(s#/usr/lib/python2.7/test/regrtest.pytrun$s   N(t__name__t __module__R3RRRR((RRRRRRRS(s#/usr/lib/python2.7/test/regrtest.pyRs!(s.Run tests in parallel using %s child processescSsog}xb|D]Z}|j}|s(q ntj|j}|tkr |jd|t|fq q W|S(Ns%s (%s)(RRtRtPROGRESS_MIN_TIMERR$(tworkerstrunningtworkerRtdt((s#/usr/lib/python2.7/test/regrtest.pyt get_running3s   $ttimeouts running: %ss, s (%s)s -- running: %stKeyboardInterruptsRun tests sequentiallys%s -- %sc s>tdddd}||S(NRMRRS(RR3(R(( RkRMRRRLR@RaRSR=(s#/usr/lib/python2.7/test/regrtest.pyt local_runtestys   sresult = local_runtest()tglobalstlocalsR(s"Re-running test %r in verbose modes%s in %ssWarning: test createdsuncollectable object(s).csg}r|jdnGr8r8|jdn+tfsc|jdnry|jdn|s|jdndj|}rd|f}n|S(NtFAILUREs ENV CHANGEDs NO TEST RUNRZtSUCCESSs, s %s then %s(RtanyR(R((RdReRnt first_resultRft interruptedRi(s#/usr/lib/python2.7/test/regrtest.pytget_tests_results csHdGHro roHdGHt ttt }tt|dGdGHt|nr r rH r r rtdkrdGnttdGdGHnr jdtHd GHx* d D]\}}d ||fGHqWnrI rIHttdGd GHtnr rHd jttdGHtn rN rN rNHtt dGdGHt t}tj }|j r9t |j t }|r)tt|dGdG|dGHt|qKdG|dGHqNdGHdG|dGHnr~dGHdttdGHtn rdGHdtt dGHt ndS(Ns== Tests result: %s ==s(Test suite interrupted by signal SIGINT.Rasomitted:itAllsOK.treverses10 slowest tests:i s - %s: %.1fssfailed:s%{} altered the execution environment:sskipped:tskips unexpected onROsThose skips are all expected ont.s6Ask someone to teach regrtest.py about which tests aresexpected to get skipped onRs%s:s re-run tests%s run no tests:( tsetRXRrt printlisttsortRlRqt_ExpectedSkipsRtplatformtisvalidt getexpected(tomittedRcRatetplattsurprise(RdReRRfRRLt print_slowR@trerunRgRhtselectedRiRj(s#/usr/lib/python2.7/test/regrtest.pytdisplay_resultsf  * '            s'Re-running failed tests in verbose modeRRas failed again:tws t show_missingtsummarytcoverdirsleaks %dsTotal duration: %ssTests result: %si(s-hs--help(s-vs --verbose(s-ws --verbose2(s-Ws --verbose3(s-Gs --failfast(s-qs--quiet(s-xs --exclude(s-ss--single(s-Ss--slows --slowest(s-rs --randomize(s-fs --fromfile(s-ms--match(s-ls --findleaks(s-Ls --runleaks(s-ts --threshold(s-Ts --coverage(s-Ds --coverdir(s-Ns --nocoverdir(s-Rs --huntrleaks(ii(s-Ms --memlimit(s-us--use(s-Fs --forever(s-js--multiprocess(s-Ps--pgo(RtRtrecord_original_stdoutRRwtgetopttargvterrorRR3trandomt randrangeRRlRRR,tpathRtSAVEDCWDtopenRtgct set_thresholdtgetcwdtsplitRrt set_memlimittlowert ALL_RESOURCEStRESOURCE_NAMEStremoveRRqRtabspathtinserttdirnameRR/tglobtchdirtTEMPDIRtisdirtrmtreetunlinkRRRRRZt __class__RRR1treadtclosetIOErrorR6RtremovepytSTDTESTStNOTTESTStcopytaddt findteststindext IndexErrort list_casesRGtTraceRRR4tlisttiterRtpython_implementationtversiont byteorderR2tseedtshufflet threadingRRRR RRtretcompiletargs_from_interpreter_flagst executabletrangetstarttmaxtPROGRESS_UPDATERR&RxR*RYR$tAssertionErrorRt enumerateRRtrunctxRR\R[tcollecttgarbageR:R=R]R^R_RXRtwritetresultst write_resultstsystemtgetpid([RmRSR=R@RARBREtfromfileRFRRGRRIRR>Rt random_seedtuse_mpR?RJRKRLRMRtoptsRRt slaveargst list_teststlist_cases_optt cleanup_teststotatfilenametfpRzRtxtuRURt regrtest_dirRtwarmupt repetitionsRRRtkwargsR(Rt found_garbaget next_testtgutststdteststnotteststargtdisplay_headertallteststnext_single_testttracerR8RoRtncpuRRRRtopt_argsRtiRRRtfinishedRyt get_timeouttitemRRwRRbRcttextt previous_testRRtnsRtduration(("RRRkRdRRReRnRMRRRfRRRRRRLRR@R}RRgRhRRiRaR~RRjRSRmRR=s#/usr/lib/python2.7/test/regrtest.pytmainRsN                                                       (                                                     ,       !           $  .5"                   '           !6B            t test_grammart test_opcodest test_dictt test_builtinttest_exceptionst test_typest test_unittestt test_doctestt test_doctest2t test_supportt test_future1t test_future2c Cst|}tj|}g}t||B}x^|D]V}tjj|\}}|d dkr8|dkr8||kr8|j|q8q8W|t|S(s-Return a list of all applicable test modules.ittest_s.py(t findtestdirR,tlistdirRRtsplitextRtsorted( RSR2R3tnamesRmtothersRtmodnametext((s#/usr/lib/python2.7/test/regrtest.pyRPs  (c Cs{|t_|dk r!|t_nzEtj|tt_|rLtt_nt ||||||SWdt ||XdS(sRun a single test. test -- the name of the test verbose -- if true, print more messages quiet -- if true, don't print 'skipped' messages (probably redundant) test_times -- a list of (time, test_name) pairs huntrleaks -- run multiple times to test for leaks; requires a debug build; a triple corresponding to -R's three arguments pgo -- if true, do not print unnecessary info when running the test for Profile Guided Optimization build Returns one of the test result constants: CHILD_ERROR Child process crashed INTERRUPTED KeyboardInterrupt when run under -j RESOURCE_DENIED test skipped because resource denied SKIPPED test skipped for some other reason ENV_CHANGED test failed because it changed the execution environment FAILED test failed PASSED test passed EMPTY_TEST_SUITE test ran no subtests. N( RR=R3Rtset_match_testsRtenvironment_alteredRlRMt runtest_innertcleanup_test_droppings( RaR=R@RRRLRMRRS((s#/usr/lib/python2.7/test/regrtest.pyR\s      tsaved_test_environmentc BseZdZeZdeedZd#Zd Zd ZdZ dZ dZ dZ dZ dZdZdZdZdZdZdZdZdZdZdZdZdZd Zd!Zd"ZRS($sSave bits of the test environment and restore them at block exit. with saved_test_environment(testname, verbose, quiet): #stuff Unless quiet is True, a warning is printed to stderr if any of the saved items was changed by the test. The attribute 'changed' is initially False, but is set to True if a change is detected. If verbose is more than 1, the before and after state of changed items is also printed. icCs(||_||_||_||_dS(N(ttestnameR=R@RL(RR^R=R@RL((s#/usr/lib/python2.7/test/regrtest.pyt__init__s   ssys.argvtcwds sys.stdins sys.stdouts sys.stderrs os.environssys.pathsasyncore.socket_maptfilescCsttjtjtjfS(N(tidRR(R((s#/usr/lib/python2.7/test/regrtest.pyt get_sys_argvscCs|dt_|dtj(dS(Nii(RR(Rt saved_argv((s#/usr/lib/python2.7/test/regrtest.pytrestore_sys_argvs cCs tjS(N(R,R(R((s#/usr/lib/python2.7/test/regrtest.pytget_cwdscCstj|dS(N(R,R(Rt saved_cwd((s#/usr/lib/python2.7/test/regrtest.pyt restore_cwdscCstjS(N(RRw(R((s#/usr/lib/python2.7/test/regrtest.pytget_sys_stdoutscCs |t_dS(N(RRw(Rt saved_stdout((s#/usr/lib/python2.7/test/regrtest.pytrestore_sys_stdoutscCstjS(N(RR(R((s#/usr/lib/python2.7/test/regrtest.pytget_sys_stderrscCs |t_dS(N(RR(Rt saved_stderr((s#/usr/lib/python2.7/test/regrtest.pytrestore_sys_stderrscCstjS(N(Rtstdin(R((s#/usr/lib/python2.7/test/regrtest.pyt get_sys_stdinscCs |t_dS(N(RRo(Rt saved_stdin((s#/usr/lib/python2.7/test/regrtest.pytrestore_sys_stdinscCs"ttjtjttjfS(N(RbR,tenvironR(R((s#/usr/lib/python2.7/test/regrtest.pytget_os_environscCs2|dt_tjjtjj|ddS(Nii(R,Rstcleartupdate(Rt saved_environ((s#/usr/lib/python2.7/test/regrtest.pytrestore_os_environs  cCsttjtjtjfS(N(RbRR(R((s#/usr/lib/python2.7/test/regrtest.pyt get_sys_pathscCs|dt_|dtj(dS(Nii(RR(Rt saved_path((s#/usr/lib/python2.7/test/regrtest.pytrestore_sys_paths cCs+tjjd}|r'|jjp*iS(Ntasyncore(RR4R&t socket_mapR(RR|((s#/usr/lib/python2.7/test/regrtest.pytget_asyncore_socket_mapscCsEtjjd}|dk rA|jdt|jj|ndS(NR|t ignore_all(RR4R&R3t close_allRlR}Rv(Rt saved_mapR|((s#/usr/lib/python2.7/test/regrtest.pytrestore_asyncore_socket_maps cCsFtjjtjrd}n$tjjtjr<d}nd}|S(Ntftd(R,RtisfileRtTESTFNRR3(RR(((s#/usr/lib/python2.7/test/regrtest.pytget_support_TESTFNs   cCsc|dkr_tjjtjr4tjtjq_tjjtjr_tj tjq_ndS(N( R3R,RRRRRRtshutilR(Rt saved_value((s#/usr/lib/python2.7/test/regrtest.pytrestore_support_TESTFNs  cCs tdtjtjDS(Ncss1|]'}|tjj|r$dndVqdS(t/RN(R,RR(t.0tfn((s#/usr/lib/python2.7/test/regrtest.pys s(RTR,RRtcurdir(R((s#/usr/lib/python2.7/test/regrtest.pyt get_filess cCsptj}||krl|d|krltjj|rGtj|qltjj|rltj|qlndS(NR(RRR,RRRRR(RRR((s#/usr/lib/python2.7/test/regrtest.pyt restore_filess  ccs^xW|jD]L}|jdd}d|}d|}|t||t||fVq WdS(NRRtget_trestore_(t resourcestreplacetgetattr(RRt method_suffixtget_namet restore_name((s#/usr/lib/python2.7/test/regrtest.pyt resource_infos   cCs#td|jD|_|S(Ncss'|]\}}}||fVqdS(N((RRR&trestore((s#/usr/lib/python2.7/test/regrtest.pys s(RRt saved_values(R((s#/usr/lib/python2.7/test/regrtest.pyt __enter__s c Cs|j}|`|jtjO_x|jD]\}}}|}|j|} || kr.t|_|| |j r|j rt j dj ||j IJt j dj | |IJqq.q.Wt S(Ns Warning -- {} was modified by {}s Before: {} After: {} (RtchangedRRZRtpopRlR@RLRRRqR^R( Rtexc_typetexc_valtexc_tbRRR&Rtcurrenttoriginal((s#/usr/lib/python2.7/test/regrtest.pyt__exit__ s"     ( ssys.argvR`s sys.stdins sys.stdouts sys.stderrs os.environssys.pathsasyncore.socket_mapRa(RRRRRR_RRcReRfRhRiRkRlRnRpRrRtRxRyR{R~RRRRRRRR(((s#/usr/lib/python2.7/test/regrtest.pyR]s:                       cCstjdS(N(Rt reap_children(((s#/usr/lib/python2.7/test/regrtest.pytpost_test_cleanup%sc Cstj||rd}n tj}d}t}ytj} z|rU|t_nt||} tt ||||} t j } t | t t g} | jdrt| |}n| }t|dd}|rt|||||}n|dk r|nt j | }WdQXtWd| t_XWntjk r}| r| r|GdG|GHtjjnt|fStjk r}| r| r|GdG|GHtjjnt|fStk rntjk r;}|s$tjdI|IdI|IJntjjt|fStjk rUt|fStjd \}}|stjdI|IdIt|d I|IJntjj|r| rt j!d tjtjjnt|fSX|rt|fS| j"rt#|fS|s|r't$|fS|j%}|sCt$|fSdG|Gd GHd d GH|GHd d GHtjjt|fSdS(Ngstest.t test_mains skipped --Ras failed --is crashed --ROtfilesproduced unexpected output:t*iF(&RR7R3tStringIORRRwtget_abs_modulet clear_cachesR]Rtt __import__RRR6Rtdash_RRtResourceDeniedRxR_tunittesttSkipTestR^Rt TestFailedRR\t TestDidNotRunR`texc_infotstrt tracebackt print_excRR]R[tgetvalue(RaR=R@RRLRStcapture_stdoutRctrefleakt save_stdouttabstestt environmentRt the_packaget the_modulet indirect_testRttypetvalueR((s#/usr/lib/python2.7/test/regrtest.pyR[(s               "   2              cCsAddl}ddl}|jxtjdfD]}tjj|sPq2ntjj|rudt j }}n5tjj |rdtj }}nt d||rd|||fGHnyAttdrtj||j|jB|jBn||Wq2tk r8}tjd||||fIJq2Xq2WdS( Nitdb_homet directoryRs8os.path says %r exists but is neither directory nor files%r left behind %s %rtchmods3%r left behind %s %r and it couldn't be removed: %s(tstatRRRRR,RtexistsRRRRRt SystemErrorRsRtS_IRWXUtS_IRWXGtS_IRWXOt ExceptionRR(R^R=RRRtkindtnukerR((s#/usr/lib/python2.7/test/regrtest.pyR\{s,      $ c)sddl}ddl}ddl}ttdsBtdnttj}|j j } tj j } yddl } Wnt k rd} nX| jj } i} ||f}xg|D]%}|jD]}t||^qqD]L}t|ds qnx.|j|gD]}|jj | |s iicsj||S(N(t setdefault(R(tint_pool(s#/usr/lib/python2.7/test/regrtest.pytget_pooled_intscs dS(N(((R(s#/usr/lib/python2.7/test/regrtest.pyt run_the_testscstjdS(N(timptreload((R(s#/usr/lib/python2.7/test/regrtest.pyRsit beginningR-t 1234567890i iRcSstd|DS(Ncss|]}|dkVqdS(iN((Rtdelta((s#/usr/lib/python2.7/test/regrtest.pys s(RQ(tdeltas((s#/usr/lib/python2.7/test/regrtest.pytcheck_rc_deltass cSs t|S(N(R(R((s#/usr/lib/python2.7/test/regrtest.pytcheck_fd_deltas st referencessfile descriptorss%s leaked %s %s, sum=%sR&(%tcopy_regt_abcollt_pyioRsRRt warm_cachestwarningstfilterstdispatch_tableRtpath_importer_cachet zipimportR1R3t_zip_directory_cachet__all__Rt__subclasses__RRR,RRRRRRtdash_R_cleanupRRtfd_countRtsumRRxRl()RRaRRR@RRRtfstpstpicRtzdctabcsR4tmodR&tabctobjRRRtnwarmuptntrackedtfnametrepcountt rc_deltast fd_deltast rep_ranget rc_beforet fd_beforeR;trc_aftertfd_afterRRtfailedt item_nametcheckerRtrefrep((RRRs#/usr/lib/python2.7/test/regrtest.pyRs$    9                  c Csddl}ddl}|tj(|jj|jj|tjjtjj|yddl }Wnt k rnX|j j|j j|tj xC|j D]5\}} | j|_|jj|jjqWtdS(Ni(RRRRRRuRvRRRR1Rt_clear_type_cachetitemsRRt _abc_cachet_abc_negative_cacheR( RRRRRRRRRtregistry((s#/usr/lib/python2.7/test/regrtest.pyRs$       cCsddl}x/tjjD]}t|dr|`qqWytjd}Wntk rbnX|jjt j ytjd}Wntk rnX|j jytjd}Wntk rn X|j ytjd}Wntk rn X|j ytjd}Wntk r.nX|jdytjd}Wntk r`n X|jytjd }Wntk rn X|jytjd } Wntk rn X| jytjd } Wntk rnX| jjytjd } Wntk rn X| jytjd } Wntk rNn Xd| _ytjd} Wntk r|n X| jtjdS(Nit__warningregistry__sdistutils.dir_utilt _strptimeturlparseturllibturllib2tdircachet linecachet mimetypestfilecmptstructtdoctesttctypes(RRR4tvaluesRsR tKeyErrort _path_createdRuR tpurget _regex_cachet clear_cachet urlcleanuptinstall_openerR3tresett clearcachet_default_mime_typest_cachet _clearcachetmastert _reset_cacheRt gc_collect(RRtdistutils_dir_utilR R R R RRRRRRR((s#/usr/lib/python2.7/test/regrtest.pyR8s                           cCsYxtdD]}t|q WxtdD]}t|q.WttdddS(s}Create explicitly internal singletons which are created on demand to prevent false positive when hunting reference leaks.iiiN(RtchrtunichrR(R;((s#/usr/lib/python2.7/test/regrtest.pyRs cCs|ptjjtptjS(N(R,RRRR(R((s#/usr/lib/python2.7/test/regrtest.pyRQscCs\|s dSxKt|D]=\}}tjj|\}}|dkr|||stinitial_indenttsubsequent_indentN(ttextwrapR,RRT(R)twidthtindentRR,tblanks((s#/usr/lib/python2.7/test/regrtest.pyRs )cCs%|jds|r|Sd|SdS(Nstest.(R6(RSRa((s#/usr/lib/python2.7/test/regrtest.pyRscCsfx_|D]W}t|tjr,t|qt|tjrtj|r^|jGHq^qqWdS(N(t isinstanceRt TestSuitet _list_casestTestCaseRt match_testRb(tsuiteRa((s#/usr/lib/python2.7/test/regrtest.pyR6s   cCstt_tj|ttj}g}xk|D]c}t||}y tj j |}t |Wn!tj k r|j |nXt|q2W|rtjJtjtt|dIdIJt|dtjndS(NRasskipped:R(RRR=RYRRR4RRtdefaultTestLoadertloadTestsFromNameR6RRR:RRXRrR(RSRRR8RiRaRR9((s#/usr/lib/python2.7/test/regrtest.pyRs    "sl test__locale test_bsddb185 test_bsddb3 test_commands test_crypt test_curses test_dbm test_dl test_fcntl test_fork1 test_epoll test_gdbm test_grp test_ioctl test_largefile test_kqueue test_mhlib test_openpty test_ossaudiodev test_pipes test_poll test_posix test_pty test_pwd test_resource test_signal test_spwd test_threadsignals test_timing test_wait3 test_wait4 s test_bsddb185 test_curses test_dl test_largefile test_kqueue test_ossaudiodev tlinux2s test_bsddb test_bsddb185 test_dl test_epoll test_largefile test_kqueue test_minidom test_openpty test_pyexpat test_sax test_sundry t unixware7t openunix8s test_asynchat test_bsddb test_bsddb185 test_dl test_fork1 test_epoll test_gettext test_largefile test_locale test_kqueue test_minidom test_openpty test_pyexpat test_queue test_sax test_sundry test_thread test_threaded_import test_threadedtempfile test_threading tsco_sv3se test_asynchat test_atexit test_bsddb test_bsddb185 test_bsddb3 test_commands test_crypt test_dbm test_dl test_fcntl test_fork1 test_epoll test_gdbm test_grp test_largefile test_locale test_kqueue test_mmap test_openpty test_poll test_popen2 test_pty test_pwd test_strop test_sundry test_thread test_threaded_import test_threadedtempfile test_threading test_timing triscoss test__locale test_bsddb test_bsddb3 test_curses test_epoll test_gdb test_gdbm test_largefile test_locale test_kqueue test_minidom test_ossaudiodev test_poll s test_bsddb test_bsddb185 test_curses test_dbm test_epoll test_kqueue test_gdbm test_gzip test_openpty test_zipfile test_zlib tsunos5sC test_bsddb test_bsddb185 test_curses test_dl test_epoll test_gdbm test_gzip test_largefile test_locale test_kqueue test_minidom test_openpty test_pyexpat test_sax test_zipfile test_zlib shp-ux11s test_bsddb185 test_curses test_dl test_gdbm test_epoll test_largefile test_locale test_kqueue test_mhlib test_mmap test_poll test_popen2 test_resource tatheoss test_bsddb185 test_bsddb3 test_curses test_dbm test_epoll test_ioctl test_kqueue test_largefile test_locale test_ossaudiodev test_socketserver tcygwinsN test_audioop test_bsddb185 test_bsddb3 test_commands test_curses test_dl test_epoll test_kqueue test_largefile test_mhlib test_mmap test_openpty test_ossaudiodev test_pty test_resource test_signal tos2emxs^ test_bsddb test_bsddb3 test_epoll test_gdbm test_locale test_ossaudiodev test_pep277 test_pty test_socketserver test_tcl test_tk test_ttk_guionly test_ttk_textonly test_timeout test_urllibnet test_multiprocessing tfreebsd4sH test_bsddb test_bsddb185 test_bsddb3 test_bz2 test_dl test_epoll test_gdbm test_gzip test_kqueue test_ossaudiodev test_tcl test_tk test_ttk_guionly test_ttk_textonly test_zipimport test_zlib taix5sa test_ascii_formatd test_bsddb test_bsddb3 test_ctypes test_dl test_epoll test_gdbm test_locale test_normalization test_ossaudiodev test_pep277 test_tcl test_tk test_ttk_guionly test_ttk_textonly test_multiprocessing topenbsd3sp test_ascii_formatd test_bsddb test_bsddb185 test_bsddb3 test_ctypes test_curses test_dl test_epoll test_gdbm test_locale test_ossaudiodev test_pep277 test_tcl test_tk test_ttk_guionly test_ttk_textonly test_multiprocessing tnetbsd3tfreebsd5tfreebsd6tfreebsd7tfreebsd8RcBs#eZdZdZdZRS(cCs0ddl}ddlm}t|_tjtkr,ttj}t|j |_ |j j d|j j s|j j dn|jr|j j dntjdkr|j j dntjdkrd d d d d dg}xO|D]}|j j |qWn.tdjddkr<|j j d ntjdkrddddddg}x!|D]}|j j |qjWntjdkrddddddg}x!|D]}|j j |qWntjdkr|j j d |j j d!ntjs |j j d"nt|_ndS(#Ni(t test_timeoutttest_linuxaudiodevt test_pep277RMlt test_imageopRt test_macosttest_macostoolst test_aepackt test_plistlibttest_scriptpackagesttest_applesingleusunicode-internaliRttest_unicode_filet test_winregt test_winsoundttest_startfilet test_sqlitet test_msilibtirixttest_alttest_cdttest_clttest_glt test_imgfileRAttest_sunaudiodevttest_nist test_py3kwarn(tos.pathRaRMRtvalidRRt _expectationsRRtexpectedRRtsupports_unicode_filenamest skip_expectedtmaxintRrtencodet py3kwarningRl(RR,RMtstMAC_ONLYRtWIN_ONLYt IRIX_ONLY((s#/usr/lib/python2.7/test/regrtest.pyR_.sL              cCs|jS(s@Return true iff _ExpectedSkips knows about the current platform.(Rg(R((s#/usr/lib/python2.7/test/regrtest.pyRescCs|jst|jS(snReturn set of test names we expect to skip on current platform. self.isvalid() must be true. (RRRi(R((s#/usr/lib/python2.7/test/regrtest.pyRis(RRR_RR(((s#/usr/lib/python2.7/test/regrtest.pyR-s 7 cCstjratjjtjddatjjtatjjtsatj tqandj tj }tjjt|}t j |dt tWdQXdS(s,Run main() in a temporary working directory.tsrcdirtbuildstest_python_{}R@N(t sysconfigtis_python_buildR,RRtget_config_varRRRtmkdirRqRRttemp_cwdRlRC(tTESTCWD((s#/usr/lib/python2.7/test/regrtest.pytmain_in_temp_cwdrs t__main__(YRRRuRRRRR,RRR RRRuttempfileRtRRRR4t itervaluesR9RsRRRRtresourceR1t getrlimitt RLIMIT_STACKtsoftthardtminRtnewsoftt setrlimittFixTkRR[R\R]R^R_RZRYR`RRRaRRRt gettempdirRRR$R%R*R2R:R3RRCRRRRR]RR[R\RRRRRQRRXRRR6RRhRR{RRR(((s#/usr/lib/python2.7/test/regrtest.pyts                  .                   / S ' z  c      #" ! E  %