Make pytype happy

pull/22258/head
Lidi Zheng 5 years ago
parent 57fa6ce33c
commit ce68d53dd1
  1. 1
      src/python/grpcio/grpc/_cython/_cygrpc/aio/completion_queue.pyx.pxi
  2. 2
      src/python/grpcio/grpc/_cython/_cygrpc/aio/iomgr/iomgr.pyx.pxi
  3. 1
      src/python/grpcio/grpc/_cython/_cygrpc/aio/server.pyx.pxi
  4. 12
      src/python/grpcio_tests/tests_aio/unit/server_test.py

@ -92,7 +92,6 @@ cdef class CallbackCompletionQueue(BaseCompletionQueue):
return self._cq
async def shutdown(self):
_LOGGER.debug('CallbackCompletionQueue shutdown')
grpc_completion_queue_shutdown(self._cq)
await self._shutdown_completed
grpc_completion_queue_destroy(self._cq)

@ -170,7 +170,6 @@ cdef grpc_error* asyncio_resolve(
char* host,
char* port,
grpc_resolved_addresses** res) with gil:
_LOGGER.debug('asyncio_resolve')
result = native_socket.getaddrinfo(host, port)
res[0] = tuples_to_resolvaddr(result)
@ -179,7 +178,6 @@ cdef void asyncio_resolve_async(
grpc_custom_resolver* grpc_resolver,
char* host,
char* port) with gil:
_LOGGER.debug('asyncio_resolve_async')
resolver = _AsyncioResolver.create(grpc_resolver)
resolver.resolve(host, port)

@ -754,7 +754,6 @@ cdef class AioServer:
grace: An optional float indicating the length of grace period in
seconds.
"""
_LOGGER.debug('server shutdown')
if self._status == AIO_SERVER_STATUS_READY or self._status == AIO_SERVER_STATUS_STOPPED:
return

@ -348,7 +348,7 @@ class TestServer(AioTestBase):
await self._server.stop(test_constants.SHORT_TIMEOUT)
with self.assertRaises(grpc.RpcError) as exception_context:
with self.assertRaises(aio.AioRpcError) as exception_context:
await call
self.assertEqual(grpc.StatusCode.UNAVAILABLE,
exception_context.exception.code())
@ -383,20 +383,18 @@ class TestServer(AioTestBase):
self._server.stop(test_constants.LONG_TIMEOUT),
)
with self.assertRaises(grpc.RpcError) as exception_context:
with self.assertRaises(aio.AioRpcError) as exception_context:
await call
self.assertEqual(grpc.StatusCode.UNAVAILABLE,
exception_context.exception.code())
@unittest.skip('https://github.com/grpc/grpc/issues/20818')
async def test_shutdown_before_call(self):
server_target, server, _ = _start_test_server()
await server.stop(None)
await self._server.stop(None)
# Ensures the server is cleaned up at this point.
# Some proper exception should be raised.
async with aio.insecure_channel('localhost:%d' % port) as channel:
await channel.unary_unary(_SIMPLE_UNARY_UNARY)(_REQUEST)
with self.assertRaises(aio.AioRpcError):
await self._channel.unary_unary(_SIMPLE_UNARY_UNARY)(_REQUEST)
async def test_unimplemented(self):
call = self._channel.unary_unary(_UNIMPLEMENTED_METHOD)

Loading…
Cancel
Save