Hc @sWddkZddkZddkZddkZddkZddkZddklZddklZl Z ddk l Z ddk l Z eieZddgZdd gZd d fZd efd YZdefdYZdefdYZdefdYZdefdYZdZdZdZdZdS(iN(t OptionParser(tabsdirttolist(t NoPlugins(twarnthelptverboses ~/.nosercs ~/nose.cfgtwin32tclitNoSuchOptionErrorcBseZdZRS(cCsti||||_dS(N(t Exceptiont__init__tname(tselfR ((s//usr/lib/python2.6/site-packages/nose/config.pyR s(t__name__t __module__R (((s//usr/lib/python2.6/site-packages/nose/config.pyR st ConfigErrorcBseZRS((RR(((s//usr/lib/python2.6/site-packages/nose/config.pyR#stConfiguredDefaultsOptionParsercBs\eZdZd d dZdZdZdZdZdZ dZ dZ RS( s@ Handler for options from commandline and config files. cse||_||_djo|iin|_|djofd}n||_dS(Ncs |S(((tmsgtkw(terror(s//usr/lib/python2.6/site-packages/nose/config.pyt2s(t_parsert_config_sectiontNoneRt_errort _file_error(R tparsertconfig_sectionRt file_error((Rs//usr/lib/python2.6/site-packages/nose/config.pyR +s     cCs]g}|i|ijo=x:|i|iD]"\}}|i|||fq/Wn|S(N(Rtsectionstitemstappend(R tcfgtfilenametconfigR tvalue((s//usr/lib/python2.6/site-packages/nose/config.pyt _configTuples5s  cCsg}x{|D]s}ti}y|i|Wn4tij o%}td|t|fnX|i|i||q W|S(Ns Error reading config file %r: %s(t ConfigParsertRawConfigParsertreadtErrorRtstrtextendR%(R t filenamesR#R"R!texc((s//usr/lib/python2.6/site-packages/nose/config.pyt_readFromFilenames<s c Csti}y |i}Wntj o d}nXy|i|Wn4tij o%}td|t|fnX|i||S(Nss Error reading config file %r: %s( R&R'R tAttributeErrortreadfpR)RR*R%(R tfhR!R"R-((s//usr/lib/python2.6/site-packages/nose/config.pyt_readFromFileObjectHs   cCsry |iWnKtj o?|}t|to |g}n|}|i|}nX|}|i|}|S(N(treadlineR/t isinstancet basestringR.R2(R t config_filestfilename_or_filenamesR,R#R1((s//usr/lib/python2.6/site-packages/nose/config.pyt_readConfigurationUs  cCsPd|}|i|}|djot|n|i||||dS(Ns--(t get_optionRR tprocess(R R R$tvaluesRtopt_strtoption((s//usr/lib/python2.6/site-packages/nose/config.pyt_processConfigValueds   c Csx|D]\}}}|tjoqny|i||||Wqtj o/}|id||ifd|d|qtij oQ}t|id|t |d}|id||fd|d|qXqWdS(Ns/Error reading config file %r: no such option %rR R"s--is Error reading config file %r: %s( toption_blacklistR>R RR toptparsetOptionValueErrorR*treplacetrepr( R RR#R;R R$R"R-R((s//usr/lib/python2.6/site-packages/nose/config.pyt_applyConfigurationToValuesls  %  cCsv|ii}y|i|}Wn(tj o}|it|nX|i|i|||ii||S(N(Rtget_default_valuesR8RRR*RDt parse_args(R targsR6R;R#R-((s//usr/lib/python2.6/site-packages/nose/config.pytparseArgsAndConfigFiles}sN( RRt__doc__RR R%R.R2R8R>RDRH(((s//usr/lib/python2.6/site-packages/nose/config.pyR's    tConfigcBseZdZdZdZeZdZdddZdZ dZ dZ ddZ dd Z d Zd Zd Zd ZRS(s.nose configuration. Instances of Config are used throughout nose to configure behavior, including plugin lists. Here are the default values for all config keys:: self.env = env = kw.pop('env', {}) self.args = () self.testMatch = re.compile(r'(?:^|[\b_\.%s-])[Tt]est' % os.sep) self.addPaths = not env.get('NOSE_NOPATH', False) self.configSection = 'nosetests' self.debug = env.get('NOSE_DEBUG') self.debugLog = env.get('NOSE_DEBUG_LOG') self.exclude = None self.getTestCaseNamesCompat = False self.includeExe = env.get('NOSE_INCLUDE_EXE', sys.platform in exe_allowed_platforms) self.ignoreFiles = (re.compile(r'^\.'), re.compile(r'^_'), re.compile(r'^setup\.py$') ) self.include = None self.loggingConfig = None self.logStream = sys.stderr self.options = NoOptions() self.parser = None self.plugins = NoPlugins() self.srcDirs = ('lib', 'src') self.runOnInit = True self.stopOnError = env.get('NOSE_STOP', False) self.stream = sys.stderr self.testNames = () self.verbosity = int(env.get('NOSE_VERBOSE', 1)) self.where = () self.workingDir = None cKs|idh|_}d|_|iddti|_ti|i|_ |idt  |_ d|_ |id|_ |id|_d|_t |_|idtitj|_tid tid tid f|_d|_d|_ti|_t|_d|_t|_d|_ t!|_"|idt |_#ti|_$g|_%t&|idd|_'d|_(ti)|_*|i+i,|_-|i.||i+i,|_/dS(NtenvtNOSE_TESTMATCHs(?:^|[\b_\.%s-])[Tt]estt NOSE_NOPATHt nosetestst NOSE_DEBUGtNOSE_DEBUG_LOGtNOSE_INCLUDE_EXEs^\.s^_s ^setup\.py$tlibtsrct NOSE_STOPt NOSE_VERBOSEi((slibRS((0tpopRKRGtgettostsept testMatchPattretcompilet testMatchtFalsetaddPathst configSectiontdebugtdebugLogRtexcludetgetTestCaseNamesCompattsystplatformtexe_allowed_platformst includeExet ignoreFilestincludet loggingConfigtstderrt logStreamt NoOptionstoptionsRRtpluginstsrcDirstTruet runOnInitt stopOnErrortstreamt testNamestintt verbositytwheretgetcwdt workingDirt__dict__tcopyt_defaulttupdatet_orig(R RRK((s//usr/lib/python2.6/site-packages/nose/config.pyR sB                    c Cs|ii}h|ddddd?dd@|idAdBddddCd|i ddD|idEdFddGddHd|i ddI|idJddddKd|i ddL|idMddGddKddN|ii|i|||_|S(Ps,Get the command line option parser. s-Vs --versiontactiont store_truetdesttversionRRsOutput nose version and exits-ps --pluginsRs[Output list of available plugins and exit. Combine with higher verbosity for greater details-vs --verbosetcountRxsBe more verbose. [NOSE_VERBOSE]s --verbositytstorettypeRws.Set verbosity; --verbosity=2 is the same as -vs-qs--quiett store_consttconstis-cs--configR RsLoad configuration from config file(s). May be specified multiple times; in that case, all config files will be loaded and combineds-ws--whereRysLook for tests in this directory. May be specified multiple times. The first directory passed will be used as the working directory, in place of the current working directory, which is the default. Others will be added to the list of tests to execute. [NOSE_WHERE]s-ms--matchs --testmatchR]s:Use this regular expression to find tests [NOSE_TESTMATCH]s--testsRvsRun these tests (comma-separated list). This argument is useful mainly from configuration files; on the command line, just pass the tests to run as additional arguments with no switch.s-ls--debugRasActivate debug logging for one or more systems. Available debug loggers: nose, nose.importer, nose.inspector, nose.plugins, nose.result and nose.selector. Separate multiple names with a comma.s --debug-logRbs5Log debug messages to this file (default: sys.stderr)s--logging-configs --log-configRksQLoad logging config from this file -- bypasses all other logging config settings.s-es --excludeRcs<Don't run tests that match regular expression [NOSE_EXCLUDE]s-is --includeRjs;Also run tests that match regular expression [NOSE_INCLUDE]s-xs--stopRts3Stop running tests after the first error or failures-Ps--no-path-adjustmentt store_falseR_sCDon't make any changes to sys.path when loading tests [NOSE_NOPATH]s--exeRhsLook for tests in python modules that are executable. Normal behavior is to exclude executable modules, since they may not be import-safe [NOSE_INCLUDE_EXE]s--noexesoDO NOT look for tests in python modules that are executable. (The default on the windows platform is to do so.)N(RRKRt add_optionR^RxRZRRaRbRkRtR_RhRpt loadPluginst pluginOpts(R RRKR((s//usr/lib/python2.6/site-packages/nose/config.pyR{s                    cCs|i|iS(s*Return the generated help message (Rt format_help(R R((s//usr/lib/python2.6/site-packages/nose/config.pyRscCs|ii||idS(N(Rpt addOptionsRK(R R((s//usr/lib/python2.6/site-packages/nose/config.pyRscCs|ii|idS(N(R|RR(R ((s//usr/lib/python2.6/site-packages/nose/config.pytresetscCs |iiS(N(R|R}(R ((s//usr/lib/python2.6/site-packages/nose/config.pyttodictscCs|ii|dS(N(R|R(R R((s//usr/lib/python2.6/site-packages/nose/config.pyRsN(RRRIR Rt__str__RRRRRRRRRRRR(((s//usr/lib/python2.6/site-packages/nose/config.pyRJs$ %  = /   j    RncBs eZdZdZdZRS(s9Options container that returns None for all options. cCsdS(N(R(R tattr((s//usr/lib/python2.6/site-packages/nose/config.pyt __getattr__scCstS(N(R^(R ((s//usr/lib/python2.6/site-packages/nose/config.pyt __nonzero__s(RRRIRR(((s//usr/lib/python2.6/site-packages/nose/config.pyRns cCs"ttiittiitS(s2Return path to any existing user config files (tfilterRXRRRt expanduserR6(((s//usr/lib/python2.6/site-packages/nose/config.pytuser_config_filess cCs,t}tiido |dgS|S(slReturn path to any existing user config files, plus any setup.cfg in the current working directory. s setup.cfg(RRXRR(tuser((s//usr/lib/python2.6/site-packages/nose/config.pytall_config_filess  c CsX|djotS|djotSt|}t|djotS|id jS( s(Does the value look like an on/off flag?iiit1t0tFtTtTRUEtFALSEtONtOFF(RRRRRRRR(RrR^R*tlentupper(tval((s//usr/lib/python2.6/site-packages/nose/config.pytflags   cCst|idjS(NRRRR(RRsTRUEsON(R*R(R((s//usr/lib/python2.6/site-packages/nose/config.pyt_bools(RR@RXR[ReR&Rt nose.utilRRtnose.plugins.managerRtwarningsRRRRR?R6RgR R RtobjectRRJRnRRRR(((s//usr/lib/python2.6/site-packages/nose/config.pyts0         ap