From 79611aca519183d9d8ec1d395c6e8cd98400e4d7 Mon Sep 17 00:00:00 2001 From: Richard Belleville Date: Mon, 5 Aug 2019 17:22:43 -0700 Subject: [PATCH] Fix up unit test --- examples/python/auth/customized_auth_server.py | 2 +- examples/python/auth/test/_auth_example_test.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/python/auth/customized_auth_server.py b/examples/python/auth/customized_auth_server.py index 374537c64fc..4bb74d6a871 100644 --- a/examples/python/auth/customized_auth_server.py +++ b/examples/python/auth/customized_auth_server.py @@ -82,7 +82,7 @@ def run_server(port): server.start() try: - yield server, port, + yield server, port finally: server.stop(0) diff --git a/examples/python/auth/test/_auth_example_test.py b/examples/python/auth/test/_auth_example_test.py index e2214267212..8e1a3b2b359 100644 --- a/examples/python/auth/test/_auth_example_test.py +++ b/examples/python/auth/test/_auth_example_test.py @@ -30,20 +30,20 @@ _SERVER_ADDR_TEMPLATE = 'localhost:%d' class AuthExampleTest(unittest.TestCase): def test_successful_call(self): - with customized_auth_server.run_server(0) as port: + with customized_auth_server.run_server(0) as (_, port): with customized_auth_client.create_client_channel( _SERVER_ADDR_TEMPLATE % port) as channel: customized_auth_client.send_rpc(channel) # No unhandled exception raised, test passed! def test_no_channel_credential(self): - with customized_auth_server.run_server(0) as port: + with customized_auth_server.run_server(0) as (_, port): with grpc.insecure_channel(_SERVER_ADDR_TEMPLATE % port) as channel: resp = customized_auth_client.send_rpc(channel) self.assertEqual(resp.code(), grpc.StatusCode.UNAVAILABLE) def test_no_call_credential(self): - with customized_auth_server.run_server(0) as port: + with customized_auth_server.run_server(0) as (_, port): channel_credential = grpc.ssl_channel_credentials( _credentials.ROOT_CERTIFICATE) with grpc.secure_channel(_SERVER_ADDR_TEMPLATE % port,