'The list returned by C{flushWarnings} includes only those
warnings which refer to the source of the function passed as the value
for C{offendingFunction}, if a value is passed for that parameter.'

def test_filterOnOffendingFunction(self):

    firstMessage = 'first    warning    text'
    firstCategory = UserWarning
    def one():
        warnings.warn(firstMessage, firstCategory, stacklevel=1)
    secondMessage = 'some    text'
    secondCategory = RuntimeWarning
    def two():
        warnings.warn(secondMessage, secondCategory, stacklevel=1)
    one()
    two()
    self.assertDictSubsets(self.flushWarnings(offendingFunctions=[one]), [{'category': firstCategory, 'message': firstMessage}])
    self.assertDictSubsets(self.flushWarnings(offendingFunctions=[two]), [{'category': secondCategory, 'message': secondMessage}])
