def test_commandFatalErrorsMustUseBytesForOnWireRepresentation(self):
        """
        A L{Command} subclass's C{fatalErrors} must map exceptions to byte
        strings.
        """
        error = self.assertRaises(
            TypeError, type, "NewCommand", (amp.Command, ),
            {"fatalErrors": [(ZeroDivisionError, u"foo")]})
        self.assertRegex(
            str(error), "^Fatal error names must be byte strings, "
            "got: u?'foo'$")

        A L{Command} subclass's C{fatalErrors} must map exceptions to byte
        strings.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_amp.py