'If the deprecation warning for circular deferred callbacks is
configured to be an error, the exception will become the failure
result of the Deferred.'

def test_circularChainException(self):

    self.addCleanup(setattr, warnings, 'filters', warnings.filters)
    warnings.filterwarnings('error', category=DeprecationWarning)
    d = defer.Deferred()
    def circularCallback(result):
        return d
    d.addCallback(circularCallback)
    d.callback('foo')
    failure = self.failureResultOf(d)
    failure.trap(DeprecationWarning)
