Browse Source

[tests] do not allow assert_raises_message to be called with JSONRPCException

Github-Pull: #10853
Rebased-From: 677d893ff7
0.15
John Newbery 7 years ago committed by MarcoFalke
parent
commit
623de0acbb
  1. 2
      test/functional/test_framework/util.py

2
test/functional/test_framework/util.py

@ -51,6 +51,8 @@ def assert_raises(exc, fun, *args, **kwds): @@ -51,6 +51,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'])

Loading…
Cancel
Save