aboutsummaryrefslogtreecommitdiff
path: root/tests/testing.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/testing.py')
-rw-r--r--tests/testing.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/testing.py b/tests/testing.py
index d70ded6..c5013dc 100644
--- a/tests/testing.py
+++ b/tests/testing.py
@@ -7,3 +7,12 @@ from nose.tools import nottest
def test_path(path):
this_dir = os.path.dirname(__file__)
return os.path.join(this_dir, "test-data", path)
+
+
+def assert_raises(exception, func):
+ try:
+ func()
+ assert False, "Expected " + exception.__name__
+ except exception as error:
+ return error
+