In nose2, all configuration for a test run is encapsulated in a Session instance. Plugins always have the session available as self.session.
Configuration session.
Encapsulates all configuration for a given test run.
An instance of argparse.ArgumentParser. Plugins can use this directly to add arguments and argument groups, but must do so in their __init__ methods.
The argparse argument group in which plugins (by default) place their command-line arguments. Plugins can use this directly to add arguments, but must do so in their __init__ methods.
The nose2.events.PluginInterface instance contains all available plugin methods and hooks.
The list of loaded – but not necessarily active – plugins.
Current verbosity level. Default: 1.
Start directory of test run. Test discovery starts here. Default: current working directory.
Top-level directory of test run. This directory is added to sys.path. Default: starting directory.
Names of code directories, relative to starting directory. Default: [‘lib’, ‘src’]. These directories are added to sys.path and discovery if the exist.
Pattern used to discover test module files. Default: test*.py
Prefix used to discover test methods and functions: Default: ‘test’.
The config section for nose2 itself.
alias of Config
Get a config section.
Parameters: | section – The section name to retreive. |
---|---|
Returns: | instance of self.configClass. |
Load config files.
Parameters: | filenames – Names of config files to load. |
---|
Loads all names files that exist into self.config.
Load plugins.
Parameters: | modules – List of module names from which to load plugins. |
---|
Configuration values loaded from config file sections are made available to plugins in Config instances. Plugins that set configSection will have a Config instance available as self.config.
Configuration for a plugin or other entities.
Encapsulates configuration for a single plugin or other element. Corresponds to a ConfigParser.Section but provides an extended interface for extracting items as a certain type.
Get key value as boolean
1, t, true, on, yes and y (case insensitive) are accepted as True values. All other values are False.