Submit
Path:
~
/
/
proc
/
thread-self
/
root
/
opt
/
alt
/
python35
/
lib
/
python3.5
/
site-packages
/
nose
/
plugins
/
__pycache__
/
File Content:
base.cpython-35.opt-1.pyc
&ߍ]�e � @ sx d d l Z d d l Z d d l m Z d d l m Z d d l m Z Gd d � d e � Z Gd d � d e � Z d S) � N)�OptionConflictError)�warn)�tolistc @ s� e Z d Z d Z d Z d Z d Z d Z d Z d d � Z d d d � Z d d d � Z d d � Z d d � Z d d � Z d d � Z d S)�Plugina� Base class for nose plugins. It's recommended but not *necessary* to subclass this class to create a plugin, but all plugins *must* implement `options(self, parser, env)` and `configure(self, options, conf)`, and must have the attributes `enabled`, `name` and `score`. The `name` attribute may contain hyphens ('-'). Plugins should not be enabled by default. Subclassing Plugin (and calling the superclass methods in __init__, configure, and options, if you override them) will give your plugin some friendly default behavior: * A --with-$name option will be added to the command line interface to enable the plugin, and a corresponding environment variable will be used as the default value. The plugin class's docstring will be used as the help for this option. * The plugin will not be enabled unless this option is selected by the user. FN�d c C sS | j d k r$ | j j j � | _ | j d k rO d | j j d d � | _ d S)Nzenable_plugin_%s�-�_)�name� __class__�__name__�lower� enableOpt�replace)�self� r �/base.py�__init__! s zPlugin.__init__c C s | j | | � d S)a� Add command-line options for this plugin. The base plugin class adds --with-$name by default, used to enable the plugin. .. warning :: Don't implement addOptions unless you want to override all default option handling behavior, including warnings for conflicting options. Implement :meth:`options <nose.plugins.base.IPluginInterface.options>` instead. N)�add_options)r �parser�envr r r � addOptions'