XylotrechusZ
�
���g�e � �d � d dl Z d dlZd dlmZ d dlmZ d dlmZ G d� de� Z G d� de� Z
y) � N)�OptionConflictError)�warn)�tolistc �R � e Zd ZdZdZdZdZdZdZd� Z dd�Z
dd�Zd� Zd � Z
d
� Zd� Zy)
�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 �� � | j �)| j j j � | _ | j �%d| j j dd� z | _ y y )Nzenable_plugin_%s�-�_)�name� __class__�__name__�lower� enableOpt�replace��selfs �@/opt/hc_python/lib/python3.12/site-packages/nose/plugins/base.py�__init__zPlugin.__init__! sR � ��9�9�����/�/�5�5�7�D�I��>�>�!�/�$�)�)�2C�2C�C��2M�M�D�N� "� c �( � | j ||� y)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�envs r �
addOptionszPlugin.addOptions'