diff options
author | Eric Gribkoff <ericgribkoff@google.com> | 2018-12-19 09:44:38 -0800 |
---|---|---|
committer | Eric Gribkoff <ericgribkoff@google.com> | 2018-12-21 15:04:42 -0800 |
commit | 2f029bade0cdadcfdd955773bd43cc2f061cd3f7 (patch) | |
tree | 71d4435492f44e64bfef54f89e97e4b9e457c1d5 /src/python/grpcio_tests/tests/unit/_metadata_code_details_test.py | |
parent | 806c1e0b7abcde983827db1ef1dd6a3785f0a5c8 (diff) |
Clean up server and channel objects in tests
Diffstat (limited to 'src/python/grpcio_tests/tests/unit/_metadata_code_details_test.py')
-rw-r--r-- | src/python/grpcio_tests/tests/unit/_metadata_code_details_test.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/python/grpcio_tests/tests/unit/_metadata_code_details_test.py b/src/python/grpcio_tests/tests/unit/_metadata_code_details_test.py index 0dafab827a..a63664ac5d 100644 --- a/src/python/grpcio_tests/tests/unit/_metadata_code_details_test.py +++ b/src/python/grpcio_tests/tests/unit/_metadata_code_details_test.py @@ -198,8 +198,8 @@ class MetadataCodeDetailsTest(unittest.TestCase): port = self._server.add_insecure_port('[::]:0') self._server.start() - channel = grpc.insecure_channel('localhost:{}'.format(port)) - self._unary_unary = channel.unary_unary( + self._channel = grpc.insecure_channel('localhost:{}'.format(port)) + self._unary_unary = self._channel.unary_unary( '/'.join(( '', _SERVICE, @@ -208,17 +208,17 @@ class MetadataCodeDetailsTest(unittest.TestCase): request_serializer=_REQUEST_SERIALIZER, response_deserializer=_RESPONSE_DESERIALIZER, ) - self._unary_stream = channel.unary_stream('/'.join(( + self._unary_stream = self._channel.unary_stream('/'.join(( '', _SERVICE, _UNARY_STREAM, )),) - self._stream_unary = channel.stream_unary('/'.join(( + self._stream_unary = self._channel.stream_unary('/'.join(( '', _SERVICE, _STREAM_UNARY, )),) - self._stream_stream = channel.stream_stream( + self._stream_stream = self._channel.stream_stream( '/'.join(( '', _SERVICE, @@ -228,6 +228,10 @@ class MetadataCodeDetailsTest(unittest.TestCase): response_deserializer=_RESPONSE_DESERIALIZER, ) + def tearDown(self): + self._server.stop(None) + self._channel.close() + def testSuccessfulUnaryUnary(self): self._servicer.set_details(_DETAILS) |