aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/python/grpcio_tests/tests/channelz/_channelz_servicer_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/python/grpcio_tests/tests/channelz/_channelz_servicer_test.py')
-rw-r--r--src/python/grpcio_tests/tests/channelz/_channelz_servicer_test.py6
1 files changed, 2 insertions, 4 deletions
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)