aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/python/grpcio_tests/tests/health_check/_health_servicer_test.py
diff options
context:
space:
mode:
authorGravatar Eric Gribkoff <ericgribkoff@google.com>2018-12-19 09:44:38 -0800
committerGravatar Eric Gribkoff <ericgribkoff@google.com>2018-12-21 15:04:42 -0800
commit2f029bade0cdadcfdd955773bd43cc2f061cd3f7 (patch)
tree71d4435492f44e64bfef54f89e97e4b9e457c1d5 /src/python/grpcio_tests/tests/health_check/_health_servicer_test.py
parent806c1e0b7abcde983827db1ef1dd6a3785f0a5c8 (diff)
Clean up server and channel objects in tests
Diffstat (limited to 'src/python/grpcio_tests/tests/health_check/_health_servicer_test.py')
-rw-r--r--src/python/grpcio_tests/tests/health_check/_health_servicer_test.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/python/grpcio_tests/tests/health_check/_health_servicer_test.py b/src/python/grpcio_tests/tests/health_check/_health_servicer_test.py
index 350b5eebe5..c1d9436c2f 100644
--- a/src/python/grpcio_tests/tests/health_check/_health_servicer_test.py
+++ b/src/python/grpcio_tests/tests/health_check/_health_servicer_test.py
@@ -39,8 +39,12 @@ class HealthServicerTest(unittest.TestCase):
health_pb2_grpc.add_HealthServicer_to_server(servicer, self._server)
self._server.start()
- channel = grpc.insecure_channel('localhost:%d' % port)
- self._stub = health_pb2_grpc.HealthStub(channel)
+ self._channel = grpc.insecure_channel('localhost:%d' % port)
+ self._stub = health_pb2_grpc.HealthStub(self._channel)
+
+ def tearDown(self):
+ self._server.stop(None)
+ self._channel.close()
def test_empty_service(self):
request = health_pb2.HealthCheckRequest()