def test_assertWarnsMultipleWarnings(self):
        """
        C{assertWarns} does not raise an exception if the function it is passed
        triggers the same warning more than once.
        """
        def deprecated():
            warnings.warn("Woo deprecated", category=PendingDeprecationWarning)
        def f():
            deprecated()
            deprecated()
        self.assertWarns(
            PendingDeprecationWarning, "Woo deprecated", __file__, f)

        C{assertWarns} does not raise an exception if the function it is passed
        triggers the same warning more than once.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/trial/test/test_assertions.py