def test_chainedErrorCleanup(self):
        d = defer.Deferred()
        d.addCallback(lambda ign: defer.fail(RuntimeError("zoop")))
        d.callback(None)

        # Sanity check - this isn't too interesting, but we do want the original
        # Deferred to have gotten the failure.
        results = []
        errors = []
        d.addCallbacks(results.append, errors.append)
        self.assertEquals(results, [])
        self.assertEquals(len(errors), 1)
        errors[0].trap(Exception)

        # Get rid of any references we might have to the inner Deferred (none of
        # these should really refer to it, but we're just being safe).
        del results, errors, d
        # Force a collection cycle so that there's a chance for an error to be
        # logged, if it's going to be logged.
        gc.collect()
        # And make sure it is not.
        self.assertEquals(self._loggedErrors(), [])
If one Deferred with an error result is returned from a callback on
dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/test/test_defer.py/LogTestCase.test_chainedErrorCleanup