From: Zooko O'Whielacronx Date: Tue, 27 Jan 2009 21:35:05 +0000 (-0700) Subject: setup: fix test_runner to assert that lines which are output to stderr must end with... X-Git-Tag: allmydata-tahoe-1.3.0~137 X-Git-Url: https://git.rkrishnan.org/webapi.txt?a=commitdiff_plain;h=1ae08acc8f0aae8c0cbd320fd308161f38f86192;p=tahoe-lafs%2Ftahoe-lafs.git setup: fix test_runner to assert that lines which are output to stderr must end with a punctuation mark (apparently re.search("x$", "x\r\n") does not match. :-() --- diff --git a/src/allmydata/test/test_runner.py b/src/allmydata/test/test_runner.py index 7e0f084c..1cada529 100644 --- a/src/allmydata/test/test_runner.py +++ b/src/allmydata/test/test_runner.py @@ -60,8 +60,9 @@ class CreateNode(unittest.TestCase, common_util.SignalMixin): self.failUnlessEqual(out, "") self.failUnless("is not empty." in err) - # Fail if there is a line that doesn't end with a PUNCTUATION MARK. - self.failIf(re.search("[^\.!?]\n", err), err) + # Fail if there is a non-empty line that doesn't end with a PUNCTUATION MARK. + for line in err.splitlines(): + self.failIf(re.search("[\S][^\.!?]$", line), (line,)) d.addCallback(_cb2) c2 = os.path.join(basedir, "c2") @@ -113,8 +114,9 @@ class CreateNode(unittest.TestCase, common_util.SignalMixin): self.failUnlessEqual(out, "") self.failUnless("is not empty" in err) - # Fail if there is a line that doesn't end with a PUNCTUATION MARK. - self.failIf(re.search("[^\.!?]\n", err), err) + # Fail if there is a non-empty line that doesn't end with a PUNCTUATION MARK. + for line in err.splitlines(): + self.failIf(re.search("[\S][^\.!?]$", line), (line,)) d.addCallback(_cb2) c2 = os.path.join(basedir, "c2")