BTW the MockObject inherits users_grpc.grpc.ServicerContext. On Tuesday, May 31, 2022 at 11:04:16 AM UTC-4 Jason Hoppes wrote:
> I have a method AddUser in my gRPC interface. I am trying to test using > pytest. I created a mock Context. > > The generated code creates the signature: > > def AddUser(self, request, context) > > When I call this with the MockContext object I get the error: > > TypeError: unsupported operand type(s) for +: 'float' and 'MockContext' > > For s & g I added the __add__ method to my context object and returned a > float. I still got the same error. > > Could someone please help me so,ve this problem? > > Thank you. > -- You received this message because you are subscribed to the Google Groups "grpc.io" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/c66531b8-b0c3-48e5-96cc-652476908863n%40googlegroups.com.
