summaryrefslogtreecommitdiff
path: root/nose
diff options
context:
space:
mode:
authorcatechism <zerbie@gmail.com>2009-05-01 11:38:45 -0500
committercatechism <zerbie@gmail.com>2009-05-01 11:38:45 -0500
commit6be82db282886a963535420d856c00d2bdb72eca (patch)
tree77d1b1a34253661eb2e8011ac88fa8b23b9e36db /nose
parent3a8875d03f28d3685e87334879386659631721a1 (diff)
downloadnose-6be82db282886a963535420d856c00d2bdb72eca.tar.gz
small tweaks for consistency
Diffstat (limited to 'nose')
-rw-r--r--nose/plugins/base.py37
1 files changed, 17 insertions, 20 deletions
diff --git a/nose/plugins/base.py b/nose/plugins/base.py
index c01c985..4e9db89 100644
--- a/nose/plugins/base.py
+++ b/nose/plugins/base.py
@@ -5,8 +5,8 @@ from warnings import warn
from nose.util import tolist
class Plugin(object):
- """Base class for nose plugins. It's not *necessary* to subclass this
- class to create a plugin; however, all plugins must implement
+ """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 ('-').
@@ -110,10 +110,8 @@ class IPluginInterface(object):
raise TypeError("IPluginInterface class is for documentation only")
def addOptions(self, parser, env):
- """Called to allow plugin to register command line
- options with the parser.
-
- Do *not* return a value from this method unless you want to stop
+ """Called to allow plugin to register command-line options with the
+ parser. DO NOT return a value from this method unless you want to stop
all other plugins from setting their options.
.. Note:: DEPRECATED -- implement `options` instead.
@@ -248,18 +246,17 @@ class IPluginInterface(object):
def beforeContext(self):
"""Called before a context (generally a module) is
- examined. Since the context is not yet loaded, plugins don't
+ examined. Because the context is not yet loaded, plugins don't
get to know what the context is; so any context operations
should use a stack that is pushed in `beforeContext` and popped
in `afterContext` to ensure they operate symmetrically.
- `beforeContext` and `afterContext` are mainly
- useful for tracking and restoring global state around possible
- changes from within a context, whatever the context may be. If
- you need to operate on contexts themselves, see `startContext`
- and `stopContext`, which are passed the context in question, but
- are called after it has been loaded (imported in the module
- case).
+ `beforeContext` and `afterContext` are mainly useful for tracking
+ and restoring global state around possible changes from within a
+ context, whatever the context may be. If you need to operate on
+ contexts themselves, see `startContext` and `stopContext`, which
+ are passed the context in question, but are called after
+ it has been loaded (imported in the module case).
"""
pass
beforeContext._new = True
@@ -307,7 +304,7 @@ class IPluginInterface(object):
config storage or changes to state or operation that are set
by command line options.
- Do *not* return a value from this method unless you want to
+ DO NOT return a value from this method unless you want to
stop all other plugins from being configured.
"""
pass
@@ -316,11 +313,11 @@ class IPluginInterface(object):
"""Called after all report output, including output from all
plugins, has been sent to the stream. Use this to print final
test results or perform final cleanup. Return None to allow
- other plugins to continue printing, any other value to stop
+ other plugins to continue printing, or any other value to stop
them.
.. Note:: When tests are run under a test runner other than
- :class:`nose.core.TextTestRunner`, for example when tests are run
+ :class:`nose.core.TextTestRunner`, such as
via ``python setup.py test``, this method may be called
**before** the default report output is sent.
"""
@@ -357,7 +354,7 @@ class IPluginInterface(object):
def formatFailure(self, test, err):
"""Called in result.addFailure, before plugin.addFailure. If you
want to replace or modify the error tuple, return a new error
- tuple. Since this method is chainable, you must return the
+ tuple. Because this method is chainable, you must return the
test as well, so you you'll return something like::
return (test, err)
@@ -539,7 +536,7 @@ class IPluginInterface(object):
"""Called to allow plugin to register command line
options with the parser.
- Do *not* return a value from this method unless you want to stop
+ DO NOT return a value from this method unless you want to stop
all other plugins from setting their options.
:Parameters:
@@ -777,7 +774,7 @@ class IPluginInterface(object):
def wantModuleTests(self, module):
"""
- .. Note:: DEPRECATED -- this method will not be called, it has
+ .. Note:: DEPRECATED -- this method will not be called; it has
been folded into wantModule.
"""
pass