'L{utils.suppressWarnings} decorates a function so that the given
warnings are suppressed.'

def test_suppressWarnings(self):

    result = []
    def showwarning(self, *a, **kw):
        result.append((a, kw))
    self.patch(warnings, 'showwarning', showwarning)
    def f(msg):
        warnings.warn(msg)
    g = utils.suppressWarnings(f, (('ignore',), dict(message='This    is    message')))
    f('Sanity    check    message')
    self.assertEqual(len(result), 1)
    g('This    is    message')
    self.assertEqual(len(result), 1)
    g('Unignored    message')
    self.assertEqual(len(result), 2)
