ó š3ëSc@ssddlZddlZddlZddlZddlZddlZddlmZddlmZm Z ddl m Z ddl m Z mZejeƒZddgZdd gZd d fZed d eddƒdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZd„Zd„Zd„Zd„Z dS(iÿÿÿÿN(t OptionParser(tabsdirttolist(t NoPlugins(twarntfilterwarningsthelptverboses ~/.nosercs ~/nose.cfgtwin32tclitalwaystcategorytmodules(.*\.)?nose\.configtNoSuchOptionErrorcBseZd„ZRS(cCstj||ƒ||_dS(N(t Exceptiont__init__tname(tselfR((s</opt/alt/python27/lib/python2.7/site-packages/nose/config.pyR s(t__name__t __module__R(((s</opt/alt/python27/lib/python2.7/site-packages/nose/config.pyR st ConfigErrorcBseZRS((RR(((s</opt/alt/python27/lib/python2.7/site-packages/nose/config.pyR%stConfiguredDefaultsOptionParsercBs\eZdZd d d„Zd„Zd„Zd„Zd„Zd„Z d„Z d„Z RS( s@ Handler for options from commandline and config files. csa||_||_ˆdkr-|jj‰nˆ|_|dkrT‡fd†}n||_dS(Ncs ˆ|ƒS(N((tmsgtkw(terror(s</opt/alt/python27/lib/python2.7/site-packages/nose/config.pyt4s(t_parsert_config_sectiontNoneRt_errort _file_error(Rtparsertconfig_sectionRt file_error((Rs</opt/alt/python27/lib/python2.7/site-packages/nose/config.pyR-s     cCs[g}|j|jƒkrWx9|j|jƒD]"\}}|j|||fƒq.Wn|S(N(Rtsectionstitemstappend(RtcfgtfilenametconfigRtvalue((s</opt/alt/python27/lib/python2.7/site-packages/nose/config.pyt _configTuples7s cCs†g}xy|D]q}tjƒ}y|j|ƒWn2tjk rd}td|t|ƒfƒ‚nX|j|j||ƒƒq W|S(Ns Error reading config file %r: %s(t ConfigParsertRawConfigParsertreadtErrorRtstrtextendR)(Rt filenamesR'R&R%texc((s</opt/alt/python27/lib/python2.7/site-packages/nose/config.pyt_readFromFilenames>s  cCs‰tjƒ}y |j}Wntk r2d}nXy|j|ƒWn2tjk rx}td|t|ƒfƒ‚nX|j||ƒS(Nss Error reading config file %r: %s( R*R+RtAttributeErrortreadfpR-RR.R)(RtfhR%R&R1((s</opt/alt/python27/lib/python2.7/site-packages/nose/config.pyt_readFromFileObjectJs    cCsny |jWnGtk rT|}t|tƒr<|g}n|}|j|ƒ}nX|}|j|ƒ}|S(N(treadlineR3t isinstancet basestringR2R6(Rt config_filestfilename_or_filenamesR0R'R5((s</opt/alt/python27/lib/python2.7/site-packages/nose/config.pyt_readConfigurationWs   cCsNd|}|j|ƒ}|dkr4t|ƒ‚n|j||||ƒdS(Ns--(t get_optionRR tprocess(RRR(tvaluesRtopt_strtoption((s</opt/alt/python27/lib/python2.7/site-packages/nose/config.pyt_processConfigValuefs   c CsãxÜ|D]Ô\}}}|tkr(qny|j||||ƒWqtk r}}|jd||jfd|d|ƒqtjk rÚ}t|ƒjd|t |ƒdƒ}|jd||fd|d|ƒqXqWdS(Ns/Error reading config file %r: no such option %rRR&s--is Error reading config file %r: %s( toption_blacklistRBR RRtoptparsetOptionValueErrorR.treplacetrepr( RRR'R?RR(R&R1R((s</opt/alt/python27/lib/python2.7/site-packages/nose/config.pyt_applyConfigurationToValuesns %  cCs¡|jjƒ}y|j|ƒ}Wn&tk rJ}|jt|ƒƒnDXy|j|j||ƒWn&tk r}|jt|ƒƒnX|jj||ƒS(N(Rtget_default_valuesR<RRR.RHt parse_args(RtargsR:R?R'R1((s</opt/alt/python27/lib/python2.7/site-packages/nose/config.pytparseArgsAndConfigFilessN( RRt__doc__RRR)R2R6R<RBRHRL(((s</opt/alt/python27/lib/python2.7/site-packages/nose/config.pyR)s    tConfigcBs§eZdZd„Zd„Zd„Zd„ZeZd„Zddd„Z d„Z d„Z d „Z dd „Zdd „Zd „Zd „Zd„Zd„ZRS(sDnose 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.py3where = () self.workingDir = None cKs|jdiƒ|_}d|_|jddtjƒ|_tj|jƒ|_ |jdt ƒ |_ d|_ |jdƒ|_ |jdƒ|_d|_t |_|jdtjtkƒ|_d d d g|_ttj|jƒ|_d|_d|_tj|_tƒ|_d|_t ƒ|_!d|_"t#|_$|jdt ƒ|_%tj|_&g|_'t(|jddƒƒ|_)d|_*d|_+tj,ƒ|_-t |_.t |_/t0|_1t |_2|j3j4ƒ|_5|j6|ƒ|j3j4ƒ|_7dS(NtenvtNOSE_TESTMATCHs(?:^|[\b_\.%s-])[Tt]estt NOSE_NOPATHt nosetestst NOSE_DEBUGtNOSE_DEBUG_LOGtNOSE_INCLUDE_EXEs^\.s^_s ^setup\.py$tlibtsrct NOSE_STOPt NOSE_VERBOSEi((slibRW(((8tpopRORKtgettostsept testMatchPattretcompilet testMatchtFalsetaddPathst configSectiontdebugtdebugLogRtexcludetgetTestCaseNamesCompattsystplatformtexe_allowed_platformst includeExetignoreFilesDefaultStringstmapt ignoreFilestincludet loggingConfigtstderrt logStreamt NoOptionstoptionsRRtpluginstsrcDirstTruet runOnInitt stopOnErrortstreamt testNamestintt verbositytwheretpy3wheretgetcwdt workingDirttraverseNamespacetfirstPackageWinsRt parserClasstworkert__dict__tcopyt_defaulttupdatet_orig(RRRO((s</opt/alt/python27/lib/python2.7/site-packages/nose/config.pyR´sN                        cCsF|jjƒ}|d=|d=|d=|d=|d=|jj|d<|S(NR{R‹R‰RORsRv(R‡RˆRvt __class__(Rtstate((s</opt/alt/python27/lib/python2.7/site-packages/nose/config.pyt __getstate__ßscCsw|jdƒ}|j|ƒt|_|ƒ|_|jjƒ|jƒ}|jj|iƒ|jj|j |ƒdS(NRv( RZRŠRxR†Rvt loadPluginsR…t addOptionst configureRu(RRt pluginclst dummy_parser((s</opt/alt/python27/lib/python2.7/site-packages/nose/config.pyt __setstate__ês     cCsƒ|jjƒ}i|dddd|j dd?dd@ƒ|jdAdBddCddd|j dd?ddDƒ|jdEdFdd"ddGdd3ddHƒ|jdIdJdd"ddKdd3ddLƒ|jdMdNdd"ddOdd3ddPƒ|jdQdRddddSd|j ddTƒ|jdUdVddWddXd|j ddYƒ|jdZdddd[d|j dd\ƒ|jd]ddWdd[dd^ƒ|jd_ddd|jdd`ddaƒ|jdbdcdddddtddeddfƒ|jdgddWdtddhddiƒ|jjƒ|j|ƒ||_|S(ks,Get the command line option parser. s-Vs --versiontactiont store_truetdesttversionRÜRsOutput nose version and exits-ps --pluginsR²s[Output list of available plugins and exit. Combine with higher verbosity for greater details-vs --verbosetcountR~sBe more verbose. [NOSE_VERBOSE]s --verbositytstoretmetavart VERBOSITYRÃR}s.Set verbosity; --verbosity=2 is the same as -vs-qs--quiett store_consttconstisBe less verboses-cs--configR$R¥tFILESsƒLoad configuration from config file(s). May be specified multiple times; in that case, all config files will be loaded and combineds-ws--whereRtWHEREsLook 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 --py3whereR€tPY3WHEREs-Look for tests in this directory under Python 3.x. Functions the same as 'where', but only applies if running under Python 3.x or above. Note that, if present under 3.x, this option completely replaces any directories specified with 'where', so the 'where' option becomes ineffective. [NOSE_PY3WHERE]s-ms--matchs --testmatchRatREGEXsŠFiles, directories, function names, and class names that match this regular expression are considered tests. Default: %s [NOSE_TESTMATCH]s--testsR|tNAMESs¸Run 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--debugResÀActivate 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-logRftFILEs5Log debug messages to this file (default: sys.stderr)s--logging-configs --log-configRqsQLoad logging config from this file -- bypasses all other logging config settings.s-Is--ignore-filesRosCompletely ignore any file that matches this regular expression. Takes precedence over any other settings or plugins. Specifying this option will replace the default setting. Specify this option multiple times to add more regular expressions [NOSE_IGNORE_FILES]s-es --excludeRgs<Don't run tests that match regular expression [NOSE_EXCLUDE]s-is --includeRps÷This regular expression will be applied to files, directories, function names, and class names for a chance to include additional tests that do not match TESTMATCH. Specify this option multiple times to add more regular expressions [NOSE_INCLUDE]s-xs--stopRzs3Stop running tests after the first error or failures-Ps--no-path-adjustmentt store_falseRcsCDon't make any changes to sys.path when loading tests [NOSE_NOPATH]s--exeRlsœLook 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.)s--traverse-namespaceRƒs8Traverse through all path entries of a namespace packages--first-package-winss--first-pkg-winss--1st-pkg-winsR„s©nose's importer will normally evict a package from sys.modules if it sees a package with the same name in a different location. Set this option to disable that behavior.s--no-byte-compileR­siPrevent nose from byte-compiling the source into .pyc files while nose is scanning for and running tests.N(RROR…t add_optionRbR~R^RReRfRqRzRcRlRƒRxRvRt pluginOpts(RR´ROR((s</opt/alt/python27/lib/python2.7/site-packages/nose/config.pyR¡¼sÎ                     cCs|j|ƒjƒS(s*Return the generated help message (R¡t format_help(RR´((s</opt/alt/python27/lib/python2.7/site-packages/nose/config.pyRTscCs|jj||jƒdS(N(RvRRO(RR((s</opt/alt/python27/lib/python2.7/site-packages/nose/config.pyRïYscCs|jj|jƒdS(N(R‡RŠR‹(R((s</opt/alt/python27/lib/python2.7/site-packages/nose/config.pytreset\scCs |jjƒS(N(R‡Rˆ(R((s</opt/alt/python27/lib/python2.7/site-packages/nose/config.pyttodict_scCs|jj|ƒdS(N(R‡RŠ(RRš((s</opt/alt/python27/lib/python2.7/site-packages/nose/config.pyRŠbsN(RRRMRRŽR”Rœt__str__R¤RR‘R¬R¯RÜR¡RRïRñRòRŠ(((s</opt/alt/python27/lib/python2.7/site-packages/nose/config.pyRNs"% +  N ;   ˜    RtcBs2eZdZd„Zd„Zd„Zd„ZRS(s9Options container that returns None for all options. cCsiS(N((R((s</opt/alt/python27/lib/python2.7/site-packages/nose/config.pyRŽiscCsdS(N((RR((s</opt/alt/python27/lib/python2.7/site-packages/nose/config.pyR”lscCsdS(N(((R((s</opt/alt/python27/lib/python2.7/site-packages/nose/config.pyt__getnewargs__oscCstS(N(Rb(R((s</opt/alt/python27/lib/python2.7/site-packages/nose/config.pyt __nonzero__rs(RRRMRŽR”RôRõ(((s</opt/alt/python27/lib/python2.7/site-packages/nose/config.pyRtfs    cCs"ttjjttjjtƒƒS(s2Return path to any existing user config files (tfilterR\RÀRØRnt expanduserR:(((s</opt/alt/python27/lib/python2.7/site-packages/nose/config.pytuser_config_filesvs cCs*tƒ}tjjdƒr&|dgS|S(slReturn path to any existing user config files, plus any setup.cfg in the current working directory. s setup.cfg(RøR\RÀRØ(tuser((s</opt/alt/python27/lib/python2.7/site-packages/nose/config.pytall_config_files}s  c CsR|dkrtS|dkr tSt|ƒ}t|ƒdkrBtS|jƒd kS( s(Does the value look like an on/off flag?iiit1t0tFtTtTRUEtFALSEtONtOFF(RûRüRýRþRÿRRR(RxRbR.tlentupper(tval((s</opt/alt/python27/lib/python2.7/site-packages/nose/config.pytflagˆs   cCst|ƒjƒdkS(NRûRþRÿR(RûRþsTRUEsON(R.R(R((s</opt/alt/python27/lib/python2.7/site-packages/nose/config.pyt_bool”s(!R¹RDR\R_RiR*Rt nose.utilRRtnose.plugins.managerRtwarningsRRR¾RR°RCR:RkRÙRR RtobjectRRNRtRøRúRR(((s</opt/alt/python27/lib/python2.7/site-packages/nose/config.pyts4         dÿÚ