From: david-sarah Date: Fri, 29 Oct 2010 19:18:04 +0000 (-0700) Subject: test_runner.py: if the only noise is 'UserWarning: Unbuilt egg for setuptools', skip... X-Git-Tag: trac-4800~26 X-Git-Url: https://git.rkrishnan.org/pf/content/en/seg/bcase/?a=commitdiff_plain;h=8c95f88b4f112328056d6a842bc2946f4b1ce359;p=tahoe-lafs%2Ftahoe-lafs.git 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. --- 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