From 256806a3dd10ccdfb1295181d09af7655c05fa29 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sun, 6 Sep 2015 18:08:58 +0100 Subject: Capture errors on trying to open file URIs --- tests/testing.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests/testing.py') 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 + -- cgit v1.2.3