nose: nose.config

Classes

Highlighted methods are defined in this class.

Config (object)

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

Methods

__init__(self, **kw)
_parseArgs(self, argv, cfg_files)
configure(self, argv=None, doc=None)

Configure the nose running environment. Execute configure before collecting tests with nose.TestCollector to enable output capture and other features.

configureLogging(self)

Configure logging for nose, or optionally other packages. Any logger name may be set with the debug option, and that logger will be set to debug level and be assigned the same handler as the nose loggers, unless it already has a handler.

configureWhere(self, where)

Configure the working directory or directories for the test run.

default(self)

Reset all config values to defaults.

getParser(self, doc=None)

Get the command line option parser.

help(self, doc=None)

Return the generated help message

pluginOpts(self, parser)
reset(self)
todict(self)
update(self, d)
NoSuchOptionError (exceptions.Exception)

Methods

__getitem__(...)(inherited from BaseException)

x.__getitem__(y) <==> x[y]

__getslice__(...)(inherited from BaseException)

x.__getslice__(i, j) <==> x[i:j]

Use of negative indices is not supported.

__init__(self, name)
__setstate__(...)(inherited from BaseException)

Attributes

args
Default value: <attribute 'args' of 'exceptions.BaseException' objects>
message
Default value: <member 'message' of 'exceptions.BaseException' objects>
ConfiguredDefaultsOptionParser (object)

Handler for options from commandline and config files.

Methods

__init__(self, parser, config_section, error=None, file_error=None)
_applyConfigurationToValues(self, parser, config, values)
_configTuples(self, cfg, filename)
_processConfigValue(self, name, value, values, parser)
_readConfiguration(self, config_files)
_readFromFileObject(self, fh)
_readFromFilenames(self, filenames)
parseArgsAndConfigFiles(self, args, config_files)
ConfigError (exceptions.Exception)

Methods

__getitem__(...)(inherited from BaseException)

x.__getitem__(y) <==> x[y]

__getslice__(...)(inherited from BaseException)

x.__getslice__(i, j) <==> x[i:j]

Use of negative indices is not supported.

__init__(...)(inherited from Exception)

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

__setstate__(...)(inherited from BaseException)

Attributes

args
Default value: <attribute 'args' of 'exceptions.BaseException' objects>
message
Default value: <member 'message' of 'exceptions.BaseException' objects>
NoOptions (object)

Options container that returns None for all options.

Methods

__init__(...)(inherited from object)

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

__nonzero__(self)

Functions

user_config_files()

Return path to any existing user config files

flag(val)

Does the value look like an on/off flag?

all_config_files()

Return path to any existing user config files, plus any setup.cfg in the current working directory.

Attributes

log
Default value: <logging.Logger instance>
exe_allowed_platforms
Default value: ('win32', 'cli')
option_blacklist
Default value: ['help', 'verbose']
config_files
Default value: ['~/.noserc', '~/nose.cfg']