aboutsummaryrefslogtreecommitdiff
path: root/qa/rpc-tests/util.py
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2014-12-03 10:51:25 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2014-12-03 10:51:36 +0100
commitc2d7c6134e282a974f8f6e2a134f0132f90dc2a0 (patch)
tree929e00e0417b43a874707ea5e49c4d86606e7eba /qa/rpc-tests/util.py
parent7eb0667384575bee4089368aec5e9c32a283a148 (diff)
parent9e56532959939f417d7603aa2a4a2c1687508897 (diff)
Merge pull request #5407
9e56532 Coinbases-in-mempool regression test (Gavin Andresen)
Diffstat (limited to 'qa/rpc-tests/util.py')
-rw-r--r--qa/rpc-tests/util.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/qa/rpc-tests/util.py b/qa/rpc-tests/util.py
index 6b66bfd8f6..ec65f783e8 100644
--- a/qa/rpc-tests/util.py
+++ b/qa/rpc-tests/util.py
@@ -330,4 +330,14 @@ def assert_equal(thing1, thing2):
def assert_greater_than(thing1, thing2):
if thing1 <= thing2:
- raise AssertionError("%s <= %s"%(str(thing1),str(thing2))) \ No newline at end of file
+ raise AssertionError("%s <= %s"%(str(thing1),str(thing2)))
+
+def assert_raises(exc, fun, *args, **kwds):
+ try:
+ fun(*args, **kwds)
+ except exc:
+ pass
+ except Exception as e:
+ raise AssertionError("Unexpected exception raised: "+type(e).__name__)
+ else:
+ raise AssertionError("No exception raised")