def setUp(self):
    "\n        Override pdb.post_mortem so we can make sure it's called.\n        "
    post_mortem = pdb.post_mortem
    origInit = failure.Failure.__init__

    def restore():
        pdb.post_mortem = post_mortem
        failure.Failure.__init__ = origInit
    self.addCleanup(restore)
    self.result = []
    pdb.post_mortem = self.result.append
    failure.startDebugMode()
Override pdb.post_mortem so we can make sure it's called.
def setUp(self):
    "\n        \n        "
    post_mortem = pdb.post_mortem
    origInit = failure.Failure.__init__

    def restore():
        pdb.post_mortem = post_mortem
        failure.Failure.__init__ = origInit
    self.addCleanup(restore)
    self.result = []
    pdb.post_mortem = self.result.append
    failure.startDebugMode()