def test_assertWarnsWrongCategory(self):
        def deprecated(a):
            warnings.warn("Foo deprecated", category=DeprecationWarning)
            return a
        self.assertRaises(self.failureException,
            self.assertWarns, UserWarning, "Foo deprecated", __file__,
            deprecated, 123)
Test assertWarns failure when the category is wrong.
dataset/ETHPy150Open nlloyd/SubliminalCollaborator/libs/twisted/trial/test/test_assertions.py/WarningAssertionTests.test_assertWarnsWrongCategory