From 81c30b1cd139b9cbe775320158c91acfc2245687 Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Wed, 9 May 2012 14:18:37 -0700 Subject: [PATCH] test_web: improve shouldFail2() error reporting --- src/allmydata/test/test_web.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/allmydata/test/test_web.py b/src/allmydata/test/test_web.py index 54a30bee..7c7b0cae 100644 --- a/src/allmydata/test/test_web.py +++ b/src/allmydata/test/test_web.py @@ -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)) -- 2.45.2