> I have a custom logger and a corresponding plug-in that reports 'PASS'
> via addSuccess() for example instead of the default output. I would
> like to log skipped tests also; I know that there is a 'skipped'
> attribute attached to the result object but I can't see a way of
> accessing that via the plug-in hooks supplied - as most refer to the
> Test instance rather than the 'result' one.
import nose.plugins.skip
...
def addError(self, test, err):
if issubclass(err[0], nose.plugins.skip.SkipTest):
log_skip(test, err)
If you want to log all error classes, not just errors, failures, and
skips, you can fish them out of the overall result of the test run (which
you can store on your plugin instance, by implementing
.prepareTestResult()). So you'd loop through result.errorClasses.items(),
much as nose.result._TextTestResult.addError() does.
John