]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
test_web: improve shouldFail2() error reporting
authorBrian Warner <warner@lothar.com>
Wed, 9 May 2012 21:18:37 +0000 (14:18 -0700)
committerBrian Warner <warner@lothar.com>
Wed, 9 May 2012 21:18:37 +0000 (14:18 -0700)
src/allmydata/test/test_web.py

index 54a30bee80336d2dac38561af64911305aed89c3..7c7b0caec83282796bcec051351df6aec4d02ca8 100644 (file)
@@ -479,9 +479,14 @@ class WebMixin(object):
             if isinstance(res, failure.Failure):
                 res.trap(expected_failure)
                 if substring:
-                    self.failUnlessIn(substring, str(res), which)
+                    self.failUnlessIn(substring, str(res),
+                                      "'%s' not in '%s' for test '%s'" % \
+                                      (substring, str(res), which))
                 if response_substring:
-                    self.failUnlessIn(response_substring, res.value.response, which)
+                    self.failUnlessIn(response_substring, res.value.response,
+                                      "'%s' not in '%s' for test '%s'" % \
+                                      (response_substring, res.value.response,
+                                       which))
             else:
                 self.fail("%s was supposed to raise %s, not get '%s'" %
                           (which, expected_failure, res))