← Back to team overview

launchpad-dev team mailing list archive

heads up: getLastOops and friends are dead.

 

Ok, my big update branch for the oops stack has landed.

ErrorReportingUtility.getLastOops, and its friends like getReportById are gone.

Never to return.

In most tests you can now just do:
self.oops_capture.sync()
report = self.oopses[-1]

to emulate getLastOops.

In doctests you need a CaptureOops instance - this is a Fixture so can
be used with setUp() + cleanUp() or a with: statement (though that
often doesn't fit with doctest narrative needs). OOPSes created in
external processes before the CaptureOoops fixture is setUp will not
be captured (the queue hasn't been created so they just get
discarded).
call sync() then inspect its oopses attribute - same as with TestCase
(Testcase.oops_capture is a CaptureOops instance).

To use this you need a test layer that includes rabbitmq, of course.

Enjoy,
Rob