check that exception messages are not empty (#22379)

Patch by Yongzhi Pan.
This commit is contained in:
Benjamin Peterson 2014-09-28 12:56:42 -04:00
parent 623ae29469
commit c31f12d196
4 changed files with 13 additions and 15 deletions

View file

@ -28,14 +28,12 @@ class UserStringTest(
realresult
)
def checkraises(self, exc, object, methodname, *args):
object = self.fixtype(object)
def checkraises(self, exc, obj, methodname, *args):
obj = self.fixtype(obj)
# we don't fix the arguments, because UserString can't cope with it
self.assertRaises(
exc,
getattr(object, methodname),
*args
)
with self.assertRaises(exc) as cm:
getattr(obj, methodname)(*args)
self.assertNotEqual(str(cm.exception), '')
def checkcall(self, object, methodname, *args):
object = self.fixtype(object)