def test_assertWarnsFilter(self):
        """
        Test assertWarns on a warning filtered by default.
        """
        def deprecated(a):
            warnings.warn("Woo deprecated", category=PendingDeprecationWarning)
            return a
        r = self.assertWarns(PendingDeprecationWarning, "Woo deprecated",
            __file__, deprecated, 123)
        self.assertEqual(r, 123)

        Test assertWarns on a warning filtered by default.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/trial/test/test_assertions.py