def cbSent(ignored):
            """
            Verify that the message was successfully delivered and flush the
            error which caused the first attempt to fail.
            """
            self.assertEqual(
                domain.messages,
                {recipient: [b"\n" + message + b"\n"]})
            # Flush the RuntimeError that BrokenMessage caused to be logged.
            self.assertEqual(len(self.flushLoggedErrors(RuntimeError)), 1)

            Verify that the message was successfully delivered and flush the
            error which caused the first attempt to fail.
            
stackoverflow/venv/lib/python3.6/site-packages/twisted/mail/test/test_smtp.py