[tests] do not allow assert_raises_message to be called with JSONRPCException
This commit is contained in:
parent
5864e9c161
commit
677d893ff7
1 changed files with 2 additions and 0 deletions
|
@ -51,6 +51,8 @@ def assert_raises(exc, fun, *args, **kwds):
|
||||||
def assert_raises_message(exc, message, fun, *args, **kwds):
|
def assert_raises_message(exc, message, fun, *args, **kwds):
|
||||||
try:
|
try:
|
||||||
fun(*args, **kwds)
|
fun(*args, **kwds)
|
||||||
|
except JSONRPCException:
|
||||||
|
raise AssertionError("Use assert_raises_jsonrpc() to test RPC failures")
|
||||||
except exc as e:
|
except exc as e:
|
||||||
if message is not None and message not in e.error['message']:
|
if message is not None and message not in e.error['message']:
|
||||||
raise AssertionError("Expected substring not found:" + e.error['message'])
|
raise AssertionError("Expected substring not found:" + e.error['message'])
|
||||||
|
|
Loading…
Reference in a new issue