Mapping exceptions to test outcomes
Map exceptions to test outcomes.
This plugin implements
setTestOutcome() to enable simple mapping
of exception classes to existing test outcomes.
By setting a list of exception classes in a nose2 config file, you can configure exceptions that would otherwise be treated as test errors, to be treated as failures or skips instead:
[outcomes] always-on = True treat-as-fail = NotImplementedError treat-as-skip = TodoError IOError
Enable this Plugin
This plugin is built-in, but not loaded by default.
Even if you specify
always-on = True in the configuration, it will not run unless you also enable it. You can do so by putting the following in a
[unittest] plugins = nose2.plugins.outcomes
plugins parameter may contain a list of plugin names, including
The default configuration is equivalent to including the following in a
[outcomes] always-on = False treat-as-fail = treat-as-skip =
- --set-outcomes DEFAULT
Treat some configured exceptions as failure or skips