def _assertLogged(self, expected):
        """
        Asserts that a given log message occurred with an expected message.
        """
        logItem = self.catcher.pop()
        self.assertEqual(logItem["message"][0], expected)
        self.assertEqual(
            self.catcher, [], "An additional log occurred: %r" % (logItem,))

        Asserts that a given log message occurred with an expected message.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/test/test_static.py