def test_bytesReprNotBytes(self):
        """
        L{twisted.python.compat._bytesRepr} raises a
        L{TypeError} when called any object that is not an instance of
        L{bytes}.
        """
        exc = self.assertRaises(TypeError, _bytesRepr, ["not bytes"])
        self.assertEquals(str(exc), "Expected bytes not ['not bytes']")

        L{twisted.python.compat._bytesRepr} raises a
        L{TypeError} when called any object that is not an instance of
        L{bytes}.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_compat.py