Add the function/method name to assertRaises.
diff --git a/Lib/unittest.py b/Lib/unittest.py
index 16f062b..931d2f6 100644
--- a/Lib/unittest.py
+++ b/Lib/unittest.py
@@ -311,9 +311,10 @@
except excClass:
return
else:
- if hasattr(excClass,'__name__'): excName = excClass.__name__
- else: excName = str(excClass)
- raise self.failureException, "%s not raised" % excName
+ excName = str(getattr(excClass, '__name__', excClass))
+ objName = str(getattr(callableObj, '__name__', callableObj))
+ raise self.failureException, "%s not raised by %s" % (excName,
+ objName)
def failUnlessEqual(self, first, second, msg=None):
"""Fail if the two objects are unequal as determined by the '=='