def test_cleared(self):
        """
        After a particular warning event has been returned by C{flushWarnings},
        it is not returned by subsequent calls.
        """
        message = "the message"
        category = RuntimeWarning
        warnings.warn(message=message, category=category)
        self.assertDictSubsets(
            self.flushWarnings(),
            [{'category': category, 'message': message}])
        self.assertEqual(self.flushWarnings(), [])

        After a particular warning event has been returned by C{flushWarnings},
        it is not returned by subsequent calls.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/trial/test/test_warning.py