Remove the default value for simple stubs

pull/22218/head
Richard Belleville 5 years ago
parent d20cebb3b4
commit 4e2ad2444d
  1. 5
      src/python/grpcio/grpc/_simple_stubs.py
  2. 7
      src/python/grpcio_tests/tests_py3_only/unit/_simple_stubs_test.py

@ -53,8 +53,9 @@ else:
def _create_channel(target: str, options: Sequence[Tuple[str, str]],
channel_credentials: Optional[grpc.ChannelCredentials],
compression: Optional[grpc.Compression]) -> grpc.Channel:
channel_credentials = channel_credentials or grpc.local_channel_credentials(
)
# TODO(rbellevi): Revisit the default value for this.
if channel_credentials is None:
raise NotImplementedError("channel_credentials must be supplied explicitly.")
if channel_credentials._credentials is grpc.experimental._insecure_channel_credentials:
_LOGGER.debug(f"Creating insecure channel with options '{options}' " +
f"and compression '{compression}'")

@ -174,13 +174,6 @@ class SimpleStubsTest(unittest.TestCase):
channel_credentials=grpc.local_channel_credentials())
self.assertEqual(_REQUEST, response)
def test_channel_credentials_default(self):
with _server(grpc.local_server_credentials()) as port:
target = f'localhost:{port}'
response = grpc.experimental.unary_unary(_REQUEST, target,
_UNARY_UNARY)
self.assertEqual(_REQUEST, response)
def test_channels_cached(self):
with _server(grpc.local_server_credentials()) as port:
target = f'localhost:{port}'

Loading…
Cancel
Save