From 69b6c047bc767b4d80e7af4d00ccb7c45b683dae Mon Sep 17 00:00:00 2001 From: Lidi Zheng Date: Thu, 29 Nov 2018 12:57:00 -0800 Subject: Update docstring of Channelz function && add default variable initialization --- src/python/grpcio_tests/tests/channelz/_channelz_servicer_test.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/python/grpcio_tests/tests/channelz') diff --git a/src/python/grpcio_tests/tests/channelz/_channelz_servicer_test.py b/src/python/grpcio_tests/tests/channelz/_channelz_servicer_test.py index f099a2c8cb..84f8594689 100644 --- a/src/python/grpcio_tests/tests/channelz/_channelz_servicer_test.py +++ b/src/python/grpcio_tests/tests/channelz/_channelz_servicer_test.py @@ -130,6 +130,7 @@ class ChannelzServicerTest(unittest.TestCase): return resp.channel[idx].ref.channel_id def setUp(self): + self._pairs = [] # This server is for Channelz info fetching only # It self should not enable Channelz self._server = grpc.server( @@ -148,10 +149,7 @@ class ChannelzServicerTest(unittest.TestCase): def tearDown(self): self._server.__del__() self._channel.close() - # _pairs may not exist, if the test crashed during setup - # In 'invalid query' tests, _pairs may never get set - if hasattr(self, '_pairs'): - _clean_channel_server_pairs(self._pairs) + _clean_channel_server_pairs(self._pairs) def test_get_top_channels_basic(self): self._pairs = _generate_channel_server_pairs(1) -- cgit v1.2.3