From 4971ddda78c1447935b811fc2aa015f039b5489f Mon Sep 17 00:00:00 2001 From: Kay Kurokawa Date: Wed, 15 Nov 2017 10:19:01 -0500 Subject: [PATCH] No need to check for None in reflector test tear down --- lbrynet/tests/functional/test_reflector.py | 24 ++++++++-------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/lbrynet/tests/functional/test_reflector.py b/lbrynet/tests/functional/test_reflector.py index 6fc50de7b..df67299ce 100644 --- a/lbrynet/tests/functional/test_reflector.py +++ b/lbrynet/tests/functional/test_reflector.py @@ -162,25 +162,17 @@ class TestReflector(unittest.TestCase): def take_down_env(self): d = defer.succeed(True) ## Close client classes ## - if self.lbry_file_manager is not None: - d.addCallback(lambda _: self.lbry_file_manager.stop()) - if self.session is not None: - d.addCallback(lambda _: self.session.shut_down()) - if self.stream_info_manager is not None: - d.addCallback(lambda _: self.stream_info_manager.stop()) + d.addCallback(lambda _: self.lbry_file_manager.stop()) + d.addCallback(lambda _: self.session.shut_down()) + d.addCallback(lambda _: self.stream_info_manager.stop()) ## Close server classes ## - if self.server_blob_manager is not None: - d.addCallback(lambda _: self.server_blob_manager.stop()) - if self.server_lbry_file_manager is not None: - d.addCallback(lambda _: self.server_lbry_file_manager.stop()) - if self.server_session is not None: - d.addCallback(lambda _: self.server_session.shut_down()) - if self.server_stream_info_manager is not None: - d.addCallback(lambda _: self.server_stream_info_manager.stop()) + d.addCallback(lambda _: self.server_blob_manager.stop()) + d.addCallback(lambda _: self.server_lbry_file_manager.stop()) + d.addCallback(lambda _: self.server_session.shut_down()) + d.addCallback(lambda _: self.server_stream_info_manager.stop()) - if self.reflector_port is not None: - d.addCallback(lambda _: self.reflector_port.stopListening()) + d.addCallback(lambda _: self.reflector_port.stopListening()) def delete_test_env(): try: