Reduce maintenance burden

pull/22688/head
Lidi Zheng 5 years ago
parent 95b4f22475
commit 1c728b3aea
  1. 16
      src/python/grpcio_status/grpc_status/rpc_status.py
  2. 4
      src/python/grpcio_tests/tests_aio/status/grpc_status_test.py

@ -79,15 +79,11 @@ def to_status(status):
status.SerializeToString()),))
__all__ = [
'from_call',
'to_status',
]
if sys.version_info[0] >= 3 and sys.version_info[1] >= 6:
from . import _async as aio
__all__ = [
'from_call',
'to_status',
'aio',
]
else:
__all__ = [
'from_call',
'to_status',
]
__all__.append('aio')

@ -144,8 +144,8 @@ class StatusTest(AioTestBase):
self.assertEqual(status.code, code_pb2.Code.Value('INTERNAL'))
# Check if the underlying proto message is intact
self.assertEqual(
status.details[0].Is(error_details_pb2.DebugInfo.DESCRIPTOR), True)
self.assertTrue(status.details[0].Is(
error_details_pb2.DebugInfo.DESCRIPTOR))
info = error_details_pb2.DebugInfo()
status.details[0].Unpack(info)
self.assertIn('_error_details_unary_unary', info.stack_entries[-1])

Loading…
Cancel
Save