def test_asyncFail(self):
        """
        Test an asynchronous failure on a remote method call.
        """
        o = LocalRemoteTest()
        d = o.callRemote("fail")
        def eb(f):
            self.assertIsInstance(f, failure.Failure)
            f.trap(RuntimeError)
        d.addCallbacks(lambda res: self.fail("supposed to fail"), eb)
        return d

        Test an asynchronous failure on a remote method call.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/spread/test/test_pb.py