summaryrefslogtreecommitdiff
path: root/nose/plugins/base.py
diff options
context:
space:
mode:
authorJason Pellerin <jpellerin@gmail.com>2007-04-24 04:27:31 +0000
committerJason Pellerin <jpellerin@gmail.com>2007-04-24 04:27:31 +0000
commit984bf51c327831a5c5a6807523be03ae56d8482a (patch)
tree3fa2f1f43084c0cfc9cf23b59789043be104c7b7 /nose/plugins/base.py
parentccb4cd753ac7b9af614e053de2729386e49a455f (diff)
downloadnose-984bf51c327831a5c5a6807523be03ae56d8482a.tar.gz
MERGE trunk r10:r196 into 0.10-dev branch: some tests now fail
Diffstat (limited to 'nose/plugins/base.py')
-rw-r--r--nose/plugins/base.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/nose/plugins/base.py b/nose/plugins/base.py
index 9d02f84..79208e4 100644
--- a/nose/plugins/base.py
+++ b/nose/plugins/base.py
@@ -109,16 +109,16 @@ class IPluginInterface(object):
`enabled` and `name`.
Plugins may implement any or all of the methods documented
- below. Please note that they `must not` subclass PluginInterface;
+ below. Please note that they *must not* subclass PluginInterface;
PluginInterface is a only description of the plugin API.
When plugins are called, the first plugin that implements a method
and returns a non-None value wins, and plugin processing ends. The
- only exceptions to are `loadTestsFromModule`, `loadTestsFromName`,
+ exceptions to this are `loadTestsFromModule`, `loadTestsFromName`,
and `loadTestsFromPath`, which allow multiple plugins to load and
return tests.
- In general, plugin methods correspond directly to the methods of
+ In general, plugin methods correspond directly to methods of
nose.selector.Selector, nose.loader.TestLoader and
nose.result.TextTestResult are called by those methods when they are
called. In some cases, the plugin hook doesn't neatly match the
@@ -131,19 +131,21 @@ class IPluginInterface(object):
Selecting and loading tests
===========================
- To alter test selection behavior, implement any necessary want*
+ To alter test selection behavior, implement any necessary `want*`
methods as outlined below. Keep in mind, though, that when your
- plugin returns True from a want* method, you will send the requested
+ plugin returns True from a `want*` method, you will send the requested
object through the normal test collection process. If the object
represents something from which normal tests can't be collected, you
must also implement a loader method to load the tests.
Examples:
+
* The builtin doctests plugin, for python 2.4 only, implements
`wantFile` to enable loading of doctests from files that are not
python modules. It also implements `loadTestsFromModule` to load
doctests from python modules, and `loadTestsFromPath` to load tests
from the non-module files selected by `wantFile`.
+
* The builtin attrib plugin implements `wantFunction` and
`wantMethod` so that it can reject tests that don't match the
specified attributes.
@@ -157,9 +159,11 @@ class IPluginInterface(object):
correspond to TextTestResult methods.
Examples:
+
* The builtin cover plugin implements `begin` and `report` to
capture and report code coverage metrics for all or selected modules
loaded during testing.
+
* The builtin profile plugin implements `begin`, `prepareTest` and
`report` to record and output profiling information. In this
case, the plugin's `prepareTest` method constructs a function that
@@ -632,7 +636,7 @@ class IPluginInterface(object):
def setOutputStream(self, stream):
"""Called before test output begins. To direct test output to a
new stream, return a stream object, which must implement a
- write(msg) method. If you only want to note the stream, not
+ `write(msg)` method. If you only want to note the stream, not
capture or redirect it, then return None.
Parameters: