'If the function called by L{utils.runWithWarningsSuppressed} returns a
C{Deferred}, the warning filters aren\'t removed until the Deferred
fires.'

def test_deferredCallback(self):

    filters = [(('ignore', '.*foo.*'), {}), (('ignore', '.*bar.*'), {})]
    result = Deferred()
    self.runWithWarningsSuppressed(filters, (lambda : result))
    warnings.warn('ignore    foo')
    result.callback(3)
    warnings.warn('ignore    foo    2')
    self.assertEqual(['ignore    foo    2'], [w['message'] for w in self.flushWarnings()])
