From: Brian Warner Date: Fri, 16 May 2008 23:08:38 +0000 (-0700) Subject: testutil.shouldFail: mention the 'which' string in substring failures too X-Git-Tag: allmydata-tahoe-1.1.0~132 X-Git-Url: https://git.rkrishnan.org/components/com_hotproperty/nxhtml.html?a=commitdiff_plain;h=1121df666441f5108bb6b751681616c8fe460e2b;p=tahoe-lafs%2Ftahoe-lafs.git testutil.shouldFail: mention the 'which' string in substring failures too --- diff --git a/src/allmydata/util/testutil.py b/src/allmydata/util/testutil.py index d62d905b..046d98e9 100644 --- a/src/allmydata/util/testutil.py +++ b/src/allmydata/util/testutil.py @@ -74,8 +74,8 @@ class ShouldFailMixin: res.trap(expected_failure) if substring: self.failUnless(substring in str(res), - "substring '%s' not in '%s'" - % (substring, str(res))) + "%s: substring '%s' not in '%s'" + % (which, substring, str(res))) else: self.fail("%s was supposed to raise %s, not get '%s'" % (which, expected_failure, res))