diff --git a/LCS/Messaging/python/messaging/test/t_messagebus.py b/LCS/Messaging/python/messaging/test/t_messagebus.py index c7fe2e8453235ddda9ce79f7961c1c11452bf1c1..a7c7ebb440c317c78082e79763d5a3ed40c17daf 100644 --- a/LCS/Messaging/python/messaging/test/t_messagebus.py +++ b/LCS/Messaging/python/messaging/test/t_messagebus.py @@ -43,10 +43,6 @@ logger = logging.getLogger(__name__) TIMEOUT = 1.0 -if not can_connect_to_broker(): - print("Cannot connect to default rabbitmq broker. Skipping test.") - exit(3) - class TestCreateDeleteFunctions(unittest.TestCase): """Test the various create/delete exchange/queue/binding funcions""" @@ -770,11 +766,8 @@ def load_tests(loader, tests, ignore): if __name__ == '__main__': logging.basicConfig(format='%(asctime)s %(thread)d %(threadName)s %(levelname)s %(message)s', level=logging.DEBUG) - try: - with ToBus(): - pass - except Exception as e: - print("Cannot run %s. Error: %s" % (__file__, e)) + if not can_connect_to_broker(): + logger.error("Cannot connect to default rabbitmq broker. Skipping test.") exit(3) unittest.main()