mirror of https://github.com/python/cpython
Add the function/method name to assertRaises.
This commit is contained in:
parent
a098294446
commit
2b6a97e69c
|
@ -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 '=='
|
||||
|
|
Loading…
Reference in New Issue