From 8c95f88b4f112328056d6a842bc2946f4b1ce359 Mon Sep 17 00:00:00 2001 From: david-sarah Date: Fri, 29 Oct 2010 12:18:04 -0700 Subject: [PATCH] test_runner.py: if the only noise is 'UserWarning: Unbuilt egg for setuptools', skip instead of failing the no_noise tests. This version avoids 'any' to be compatible with Python < 2.5. refs #1235. --- src/allmydata/test/test_runner.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/allmydata/test/test_runner.py b/src/allmydata/test/test_runner.py index e735fe71..f5d30d5d 100644 --- a/src/allmydata/test/test_runner.py +++ b/src/allmydata/test/test_runner.py @@ -157,7 +157,10 @@ class BinTahoe(common_util.SignalMixin, unittest.TestCase, SkipMixin): self.failUnlessEqual(rc_or_sig, 0, str(res)) self.failUnless(out.startswith(allmydata.__appname__+':'), str(res)) self.failIfIn("DeprecationWarning", out, str(res)) - self.failUnlessEqual(err, "", str(res)) + errlines = err.split("\n") + self.failIf([True for line in errlines if line != "" and ("UserWarning: Unbuilt egg for setuptools" not in line)], str(res)) + if err != "": + raise unittest.SkipTest("This test is known not to pass on Ubuntu Lucid; see #1235.") d.addCallback(_cb) return d @@ -439,7 +442,10 @@ class RunNode(common_util.SignalMixin, unittest.TestCase, pollmixin.PollMixin, open(HOTLINE_FILE, "w").write("") self.failUnlessEqual(rc_or_sig, 0, errstr) self.failUnlessEqual(out, "", errstr) # If you emit noise, you fail this test. - self.failUnlessEqual(err, "", errstr) + errlines = err.split("\n") + self.failIf([True for line in errlines if line != "" and ("UserWarning: Unbuilt egg for setuptools" not in line)], errstr) + if err != "": + raise unittest.SkipTest("This test is known not to pass on Ubuntu Lucid; see #1235.") # the parent (twistd) has exited. However, twistd writes the pid # from the child, not the parent, so we can't expect twistd.pid -- 2.45.2