From 58a946c6bc7cd93e6227aafa3c4598379e9c2404 Mon Sep 17 00:00:00 2001 From: John Newbery Date: Wed, 12 Jul 2017 10:29:21 -0400 Subject: [PATCH] [tests] do not allow assert_raises_message to be called with JSONRPCException --- test/functional/test_framework/util.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/functional/test_framework/util.py b/test/functional/test_framework/util.py index e1b77d4768..3acc1ae3ea 100644 --- a/test/functional/test_framework/util.py +++ b/test/functional/test_framework/util.py @@ -53,6 +53,8 @@ def assert_raises(exc, fun, *args, **kwds): def assert_raises_message(exc, message, fun, *args, **kwds): try: fun(*args, **kwds) + except JSONRPCException: + raise AssertionError("Use assert_raises_jsonrpc() to test RPC failures") except exc as e: if message is not None and message not in e.error['message']: raise AssertionError("Expected substring not found:" + e.error['message'])