Fix some werid pytype complaning

pull/22713/head
Pau Freixes 5 years ago
parent 20898aa2f2
commit 6000747f83
  1. 23
      src/python/grpcio_tests/tests_aio/unit/call_test.py

@ -218,20 +218,21 @@ class TestUnaryUnaryCall(_MulticallableTestMixin, AioTestBase):
class TestUnaryStreamCall(_MulticallableTestMixin, AioTestBase):
async def test_call_rpc_error(self):
async with aio.insecure_channel(UNREACHABLE_TARGET) as channel:
request = messages_pb2.StreamingOutputCallRequest()
stub = test_pb2_grpc.TestServiceStub(channel)
call = stub.StreamingOutputCall(request)
channel = aio.insecure_channel(UNREACHABLE_TARGET)
request = messages_pb2.StreamingOutputCallRequest()
stub = test_pb2_grpc.TestServiceStub(channel)
call = stub.StreamingOutputCall(request)
with self.assertRaises(aio.AioRpcError) as exception_context:
async for response in call:
pass
with self.assertRaises(aio.AioRpcError) as exception_context:
async for response in call:
pass
self.assertEqual(grpc.StatusCode.UNAVAILABLE,
exception_context.exception.code())
self.assertEqual(grpc.StatusCode.UNAVAILABLE,
exception_context.exception.code())
self.assertTrue(call.done())
self.assertEqual(grpc.StatusCode.UNAVAILABLE, await call.code())
self.assertTrue(call.done())
self.assertEqual(grpc.StatusCode.UNAVAILABLE, await call.code())
await channel.close()
async def test_cancel_unary_stream(self):
# Prepares the request

Loading…
Cancel
Save