From a85a22dfa276a7893bed16e8aa8808822f0afd05 Mon Sep 17 00:00:00 2001 From: David Robertson Date: Sun, 26 Oct 2003 02:54:52 +0000 Subject: [PATCH] Fixed bug, where if multiple tests using one diff file, and one test failed, subsequent tests failed on assertion errors. --- test/utils.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/utils.py b/test/utils.py index 8ca8fbb..1b9283f 100644 --- a/test/utils.py +++ b/test/utils.py @@ -167,7 +167,13 @@ class TestDiff: for cexpr in self.expectedFailures: origLine = cexpr.sub('', origLine) testLine = cexpr.sub('', testLine) - self.testInst.failUnlessEqual(origLine, testLine) + if origLine != testLine: # fails + # advance test file to next test + line = origLine + while line and line != self.divider: + line = self.origStrFile.readline() + self.testInst.failUnlessEqual(origLine, testLine) + else: # write new test file for line in testStrFile: self.dataFile.write(line)