def cbCompleted(ign):
            """
            Flush the exceptions which the reactor should have logged and make
            sure they're actually there.
            """
            errs = self.flushLoggedErrors(BadClientError)
            self.assertEqual(len(errs), 2, "Incorrectly found %d errors, expected 2" % (len(errs),))

            Flush the exceptions which the reactor should have logged and make
            sure they're actually there.
            
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_udp.py