aboutsummaryrefslogtreecommitdiff
path: root/tests/testing.py
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2015-09-06 18:08:58 +0100
committerMichael Williamson <mike@zwobble.org>2015-09-06 18:08:58 +0100
commit256806a3dd10ccdfb1295181d09af7655c05fa29 (patch)
tree682532ac1eaf1718c03430e5b61e20dfe6b03d7d /tests/testing.py
parentcff7a81ce9c49971ca94fc8fe74430338e563836 (diff)
Capture errors on trying to open file URIs
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
+