def test_rawDataError(self):
        """
        C{LineReceiver.dataReceived} forwards errors returned by
        C{rawDataReceived}.
        """
        proto = basic.LineReceiver()
        proto.rawDataReceived = lambda data: RuntimeError("oops")
        transport = proto_helpers.StringTransport()
        proto.makeConnection(transport)
        proto.setRawMode()
        why = proto.dataReceived(b'data')
        self.assertIsInstance(why, RuntimeError)

        C{LineReceiver.dataReceived} forwards errors returned by
        C{rawDataReceived}.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/protocols/test/test_basic.py