Kaydet (Commit) 2b6a97e6 authored tarafından Guido van Rossum's avatar Guido van Rossum

Add the function/method name to assertRaises.

üst a0982944
......@@ -311,9 +311,10 @@ class TestCase:
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 '=='
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment