From 0d3eaef945278c62e4750b2869b9a8ccbf11c9b5 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Mon, 29 Jan 2018 12:23:14 +1030 Subject: [PATCH] tests: add argument to is_in_log so we can check only recent log entries. Signed-off-by: Rusty Russell --- tests/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/utils.py b/tests/utils.py index 88b1702b5..f98669e20 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -108,11 +108,11 @@ class TailableProc(object): self.running = False self.proc.stdout.close() - def is_in_log(self, regex): + def is_in_log(self, regex, start = 0): """Look for `regex` in the logs.""" ex = re.compile(regex) - for l in self.logs: + for l in self.logs[start:]: if ex.search(l): logging.debug("Found '%s' in logs", regex) return True