From dcc00ac8e9240cb1b998f5bf04be84248520cb1b Mon Sep 17 00:00:00 2001 From: thephez Date: Fri, 11 Feb 2022 15:33:46 -0600 Subject: [PATCH] test: skip test properly if zmq missing (#4684) --- test/functional/interface_zmq_dash.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/test/functional/interface_zmq_dash.py b/test/functional/interface_zmq_dash.py index 40964d0600..4410ae53b1 100755 --- a/test/functional/interface_zmq_dash.py +++ b/test/functional/interface_zmq_dash.py @@ -11,10 +11,6 @@ import json import random import struct import time -try: - import zmq -finally: - pass from test_framework.test_framework import DashTestFramework from test_framework.mininode import P2PInterface @@ -104,6 +100,7 @@ class DashZMQTest (DashTestFramework): # Check that dashd has been built with ZMQ enabled. config = configparser.ConfigParser() config.read_file(open(self.options.configfile)) + import zmq try: # Setup the ZMQ subscriber socket @@ -232,6 +229,7 @@ class DashZMQTest (DashTestFramework): self.unsubscribe(chain_lock_publishers) def test_instantsend_publishers(self): + import zmq instantsend_publishers = [ ZMQPublisher.hash_tx_lock, ZMQPublisher.raw_tx_lock,