def test_publisherReportsBrokenObserversPrivately(self):
        """
        Log publisher does not use the global L{log.err} when reporting broken
        observers.
        """
        errors = []

        def logError(eventDict):
            if eventDict.get("isError"):
                errors.append(eventDict["failure"].value)

        def fail(eventDict):
            raise RuntimeError("test_publisherLocalyReportsBrokenObservers")

        publisher = log.LogPublisher()
        publisher.addObserver(logError)
        publisher.addObserver(fail)

        publisher.msg("Hello!")
        self.assertEqual(set(publisher.observers), set([logError, fail]))
        self.assertEqual(len(errors), 1)
        self.assertIsInstance(errors[0], RuntimeError)

        Log publisher does not use the global L{log.err} when reporting broken
        observers.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_log.py