From 1ae08acc8f0aae8c0cbd320fd308161f38f86192 Mon Sep 17 00:00:00 2001 From: Zooko O'Whielacronx Date: Tue, 27 Jan 2009 14:35:05 -0700 Subject: [PATCH] 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. :-() --- src/allmydata/test/test_runner.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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") -- 2.45.2