I'd like to capture the output that nose.run() prints to stdout so I can send it in an email if tests fail. I believe the LogCapture plugin does what I want, so I'm doing:
logcap = nose.plugins.logcapture.LogCapture()
success = nose.run(argv=[".", '-x'], plugins=[logcap])
The documentation for logcapture says that the captured log is saved to the test.capturedLogging
attribute. The trouble is I have no idea where that is - it's not on my logcap object above, and nose.run() only returns a boolean.
Is there a way to do what I want?