def test_repeated(self):
        """
        The same warning triggered twice from the same place is included twice
        in the list returned by C{flushWarnings}.
        """
        message = "the message"
        category = RuntimeWarning
        for i in range(2):
            warnings.warn(message=message, category=category)

        self.assertDictSubsets(
            self.flushWarnings(),
            [{'category': category, 'message': message}] * 2)

        The same warning triggered twice from the same place is included twice
        in the list returned by C{flushWarnings}.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/trial/test/test_warning.py