def test_addFailureNonASCII(self):
        """
        L{WorkerReporter.addFailure} sends a L{managercommands.AddFailure}
        message when called with a L{Failure}, even if it includes encoded
        non-ASCII content.
        """
        content = u"\N{SNOWMAN}".encode("utf-8")
        exception = RuntimeError(content)
        failure = Failure(exception)
        self.workerReporter.addFailure(self.test, failure)
        self.assertEqual(
            self.fakeAMProtocol.lastCall,
            managercommands.AddFailure,
        )
        self.assertEqual(
            content,
            self.fakeAMProtocol.lastArgs["fail"],
        )

        L{WorkerReporter.addFailure} sends a L{managercommands.AddFailure}
        message when called with a L{Failure}, even if it includes encoded
        non-ASCII content.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/trial/_dist/test/test_workerreporter.py