From: Tim Peters Date: Wed, 10 Jul 2002 02:37:21 +0000 (+0000) Subject: assertHasattr(): Made failure msg better than useless. X-Git-Tag: v2.3c1~5062 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5e5ca564762db20e5b1caf168e642b333782b957;p=python assertHasattr(): Made failure msg better than useless. test_others(): httplib failed in two new ways. Blame Thumb Boy . --- diff --git a/Lib/test/test_pyclbr.py b/Lib/test/test_pyclbr.py index 0f3319f1a4..ce352afc46 100644 --- a/Lib/test/test_pyclbr.py +++ b/Lib/test/test_pyclbr.py @@ -33,7 +33,8 @@ class PyclbrTest(unittest.TestCase): ''' succeed iff hasattr(obj,attr) or attr in ignore. ''' if attr in ignore: return if not hasattr(obj, attr): print "???", attr - self.failUnless(hasattr(obj, attr)) + self.failUnless(hasattr(obj, attr), + 'expected hasattr(%r, %r)' % (obj, attr)) def assertHaskey(self, obj, key, ignore): @@ -139,6 +140,8 @@ class PyclbrTest(unittest.TestCase): cm('aifc', ignore=('openfp',)) # set with = cm('httplib', ignore=('error', # set with = + 'sendall', # set with = + '_closedsocket', # it's a nested class 'HTTPS', 'HTTP11')) # not on all platforms