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

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