aboutsummaryrefslogtreecommitdiff
path: root/test/functional/zmq_test.py
diff options
context:
space:
mode:
authorJohn Newbery <john@johnnewbery.com>2017-05-18 16:36:39 -0400
committerJohn Newbery <john@johnnewbery.com>2017-05-22 14:46:18 -0400
commit930deb9b2c5a8234d430f0a739c97e1fc961ffad (patch)
tree70110241c9c82f3bec8c144d37febf6c37410e8f /test/functional/zmq_test.py
parente4775167cb4b15e6a37290d27009386efb1e5e97 (diff)
downloadbitcoin-930deb9b2c5a8234d430f0a739c97e1fc961ffad.tar.xz
[tests] skipped tests should clean up after themselves
Diffstat (limited to 'test/functional/zmq_test.py')
-rwxr-xr-xtest/functional/zmq_test.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/test/functional/zmq_test.py b/test/functional/zmq_test.py
index 918e13bcd4..f4d86f1b46 100755
--- a/test/functional/zmq_test.py
+++ b/test/functional/zmq_test.py
@@ -6,9 +6,8 @@
import configparser
import os
import struct
-import sys
-from test_framework.test_framework import BitcoinTestFramework
+from test_framework.test_framework import BitcoinTestFramework, SkipTest
from test_framework.util import *
class ZMQTest (BitcoinTestFramework):
@@ -24,8 +23,7 @@ class ZMQTest (BitcoinTestFramework):
try:
import zmq
except ImportError:
- self.log.warning("python3-zmq module not available. Skipping zmq tests!")
- sys.exit(self.TEST_EXIT_SKIPPED)
+ raise SkipTest("python3-zmq module not available.")
# Check that bitcoin has been built with ZMQ enabled
config = configparser.ConfigParser()
@@ -34,8 +32,7 @@ class ZMQTest (BitcoinTestFramework):
config.read_file(open(self.options.configfile))
if not config["components"].getboolean("ENABLE_ZMQ"):
- self.log.warning("bitcoind has not been built with zmq enabled. Skipping zmq tests!")
- sys.exit(self.TEST_EXIT_SKIPPED)
+ raise SkipTest("bitcoind has not been built with zmq enabled.")
self.zmqContext = zmq.Context()
self.zmqSubSocket = self.zmqContext.socket(zmq.SUB)