5Qc@sddlmZddlZddlZddlZddlZddlZddlZddlZddl Z ddl m Z ddl m Z ddlmZmZmZddlmZddlmZddlmZdd lmZmZmZid d 6d d 6d d 6d d 6dd6dd6ZdZdZdZdZ dZ!dZ"idej#fd6de"fd6Z$dZ%de&fdYZ'de'ej(e j)fdYZ(dZ*d Z+d!Z,d"Z-d#e.fd$YZ/d%Z0d&Z1dS('i(tprint_functionN(tdefer(tapp(tusagetreflecttfailure(tFilePath(tplugin(tspewer(trunnertitrialtreportertdefaulttplaintbrieftemacstverbosetcgitbcCsd}|j|t|}|j|}|dksF|dkr\td|fn|||!jd}i}x|D]|}t|jdkrqn|jd}t|dkrtd||fn|d j||djs(t _runOrdersRt UsageErrortjoin(RL((s9/usr/lib/python2.7/dist-packages/twisted/scripts/trial.pyt_checkKnownRunOrders #t _BasicOptionsc BseZdZdejjejdfZdZ ddgdddgd d;d gd d;d gd ddgdd;dgdd;dgdddggZ ddd;de gddd;dgdd;ddgd d;d!d"ggZ ejd#iejed6ed 6ejd$d%d&6ejd$d'd6d(ejd)d$d*d+egZejZd;Zd,Zd-Zd.Zd/Zd0Zd1Z d2Z!d3Z"d4Z#d5Z$d6Z%d7Z&d8Z'd9Z(d:Z)RS(<sC Basic options shared between trial and its local workers. s@%s [options] [[file|package|module|TestCase|testmethod]...] isutrial loads and executes a suite of unit tests, obtained from modules, packages and files listed on the command line.thelpths no-recursetNsDon't recurse into packagess help-orderss%Help on available test running ordersshelp-reporterss,Help on available output plugins (reporters)trterrorstes;realtime errors, print out tracebacks as soon as they occursunclean-warningss'Turn dirty reactor errors into warningssforce-gcs<Have Trial run gc.collect() before and after each test case.t exitfirsttxsSExit after the first non-successful result (cannot be specified along with --jobs).RLtosRSpecify what order to run test cases and methods. See --help-orders for more info.trandomtzs2Run tests in random order using the specified seedstemp-directoryt _trial_temps+Path to use as working directory for tests.R RsKThe reporter to use for this test run. See --help-reporters for more info.t optActionstdescrs log file nametlogfiles random seedt extraActionss*.pys/file | module | package | TestCase | testMethodtrepeatcCsg|d. s s i(RhtsortedRMRRotexit(Retsynopsistnamet descriptiont_((s9/usr/lib/python2.7/dist-packages/twisted/scripts/trial.pytopt_help_orderss  %cCsWd}t|x3tjtjD]}td|jd|jq#WtjddS(NsTrial's output can be customized using plugins called Reporters. You can select any of the following reporters using --reporter= s s i( RhRR7R R8R9RRoR}(ReR~R:((s9/usr/lib/python2.7/dist-packages/twisted/scripts/trial.pytopt_help_reporters%s  cCst|dss$Running tests shuffled with seed %d RLs until-failure( R t TestLoaderRZtRandomtseedtsorterRhRMtDestructiveTestSuitet suiteFactory(RRRR((Rs9/usr/lib/python2.7/dist-packages/twisted/scripts/trial.pyRs      cCstj}yddl}Wn%tk rCtdtjnXxjdD]b}tjj |rKyt |d}Wnt k rtjqX|j j |jqKqKW|S(sR Wrap an instance of C{pdb.Pdb} with readline support and load any .rcs. iNsreadline module not availables.pdbrctpdbrcR"(s.pdbrcR(RtPdbR$t ImportErrorRhRot exc_clearR0R1texistsR#RBtrcLinesRyt readlines(tdbgR$R1trcFile((s9/usr/lib/python2.7/dist-packages/twisted/scripts/trial.pyt _wrappedPdbs     t_DebuggerNotFoundcBseZdZRS(sk A debugger import failed. Used to allow translating these errors into usage error messages. (RRR(((s9/usr/lib/python2.7/dist-packages/twisted/scripts/trial.pyRscCsgtj}i|dd6|dd6|dd6|dd6|d d 6|d d 6}|d rntjj|d sV                 "`    -