File: //opt/alt/python37/lib/python3.7/site-packages/nose/plugins/__pycache__/base.cpython-37.pyc
B
1�Se�e � @ sX d dl Z d dlZd dlmZ d dlmZ d dlmZ G dd� de�Z G dd� de�Z
dS ) � N)�OptionConflictError)�warn)�tolistc @ s` e Zd ZdZdZdZdZdZdZdd� Z ddd�Z
dd d
�Zdd� Zd
d� Z
dd� Zdd� ZdS )�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 s: | j d kr| jj�� | _ | jd kr6d| j �dd� | _d S )Nzenable_plugin_%s�-�_)�name� __class__�__name__�lower� enableOpt�replace)�self� r �B/opt/alt/python37/lib/python3.7/site-packages/nose/plugins/base.py�__init__! s
zPlugin.__init__c C s | � ||� dS )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'