aboutsummaryrefslogtreecommitdiffstats
path: root/test/tutils.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/tutils.py')
-rw-r--r--test/tutils.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/tutils.py b/test/tutils.py
index 141979f8..95c8b80a 100644
--- a/test/tutils.py
+++ b/test/tutils.py
@@ -44,14 +44,14 @@ def raises(exc, obj, *args, **kwargs):
:kwargs Arguments to be passed to the callable.
"""
try:
- ret = apply(obj, args, kwargs)
- except Exception, v:
+ ret = obj(*args, **kwargs)
+ except Exception as v:
if isinstance(exc, basestring):
if exc.lower() in str(v).lower():
return
else:
raise AssertionError(
- "Expected %s, but caught %s"%(
+ "Expected %s, but caught %s" % (
repr(str(exc)), v
)
)
@@ -60,7 +60,7 @@ def raises(exc, obj, *args, **kwargs):
return
else:
raise AssertionError(
- "Expected %s, but caught %s %s"%(
+ "Expected %s, but caught %s %s" % (
exc.__name__, v.__class__.__name__, str(v)
)
)