diff options
-rw-r--r-- | lib/bb/tests/fetch.py | 6 | ||||
-rw-r--r-- | lib/bb/tests/parse.py | 16 |
2 files changed, 12 insertions, 10 deletions
diff --git a/lib/bb/tests/fetch.py b/lib/bb/tests/fetch.py index 8ca7e6c15..20593764f 100644 --- a/lib/bb/tests/fetch.py +++ b/lib/bb/tests/fetch.py @@ -3183,7 +3183,7 @@ class FetchPremirroronlyBrokenTarball(FetcherTest): import sys self.d.setVar("SRCREV", "0"*40) fetcher = bb.fetch.Fetch([self.recipe_url], self.d) - with self.assertRaises(bb.fetch2.FetchError): + with self.assertRaises(bb.fetch2.FetchError), self.assertLogs() as logs: fetcher.download() - stdout = sys.stdout.getvalue() - self.assertFalse(" not a git repository (or any parent up to mount point /)" in stdout) + output = "".join(logs.output) + self.assertFalse(" not a git repository (or any parent up to mount point /)" in output) diff --git a/lib/bb/tests/parse.py b/lib/bb/tests/parse.py index a3165d95b..304bbbe22 100644 --- a/lib/bb/tests/parse.py +++ b/lib/bb/tests/parse.py @@ -186,14 +186,16 @@ deltask ${EMPTYVAR} """ def test_parse_addtask_deltask(self): import sys - f = self.parsehelper(self.addtask_deltask) - d = bb.parse.handle(f.name, self.d)[''] - stdout = sys.stdout.getvalue() - self.assertTrue("addtask contained multiple 'before' keywords" in stdout) - self.assertTrue("addtask contained multiple 'after' keywords" in stdout) - self.assertTrue('addtask ignored: " do_patch"' in stdout) - #self.assertTrue('dependent task do_foo for do_patch does not exist' in stdout) + with self.assertLogs() as logs: + f = self.parsehelper(self.addtask_deltask) + d = bb.parse.handle(f.name, self.d)[''] + + output = "".join(logs.output) + self.assertTrue("addtask contained multiple 'before' keywords" in output) + self.assertTrue("addtask contained multiple 'after' keywords" in output) + self.assertTrue('addtask ignored: " do_patch"' in output) + #self.assertTrue('dependent task do_foo for do_patch does not exist' in output) broken_multiline_comment = """ # First line of comment \\ |